Ubuntu run in Raspberry pi 2 之SD 卡镜像篇(ROS开发准备)

1,首先下载最新的ubuntu版本,链接如下https://wiki.ubuntu.com/ARM/RaspberryPi;

2,把下载的img文件烧录到SD卡,链接如下http://elinux.org/RPi_Resize_Flash_Partitions;我电脑用的是ubuntu系统,(1)使用df-h, 找到设备名(比如sdb1),最好把sd插拔一次,df -h命令再执行一遍,确认设备名。(2)把SD卡从系统中卸载,输入sudo umount  /dev/sdb1 (3)之前找到的sdb1指的是设备名sdb和分区号1,所以镜像烧录的时候要把分区号去掉 使用命令 sudo dd bs=1M(不行就换4M) if=镜像路径名+镜像名.img of=/dev/sdb。

3,烧录过程没有任何提示。。。。。。。。整个过程要几分钟。。。。。。。然后给你统计信息。运行下sudo sync确保数据从系统缓存中写到SD卡中。

4,如果你使用的是8G或以上的U盘,由于系统只用了2G,如果要装xubuntu和ROS后,空间不够,最后只能格式化,重新做了。。。。。所以必须要重新分配。http://elinux.org/RPi_Easy_SD_Card_Setup 链接中有很多方法,我使用的是树莓派在运行状态来修改,其中参考了https://www.chrisnewland.com/resize-raspberry-pi-sd-card-partition-to-fill-32gb-card-from-a-running-raspberry-pi-245;具体方法还是贴一遍:

Step 1: Run fdisk as sudo
sudo fdisk -cu /dev/mmcblk0
Step 2: enter p to view the current partition table:
p
Device          Boot    Start    End        Blocks   Id    System
/dev/mmcblk0p1          2048     155647     76800    c     W95 FAT32 (LBA)
/dev/mmcblk0p2          157696   3414015    1628160  83    Linux
/dev/mmcblk0p3          3416064  3807231    195584   82    Linux swap / Solaris
Step 3: Delete partitions 2 and 3 (root and swap)
d 2
d 3
Step 4: Create a new primary partition (2) starting where the previous partition 2 started (usually 157696)
n p 2
157696-->这个数值根据你的容量来定,系统会自定义,你确认无误即可。
Enter (use remaining space)
Your partition table on a 32GB SD card will now look like this:
p
Device          Boot    Start    End        Blocks     Id    System
/dev/mmcblk0p1          2048     155647     76800      c     W95 FAT32 (LBA)
/dev/mmcblk0p2          157696   62552063   31197184   83    Linux

w (to write new partition table to the SD card)
Step 5: Reboot to reload the partition table
sudo shutdown -r now
Step 6: Resize partition 2 (Takes about 44 minutes on a class 10 SD card)
sudo resize2fs /dev/mmcblk0p2

5,接下来,如果你对GONME不感兴趣,你可以参考https://wiki.ubuntu.com/ARM/RaspberryPi,安装其他桌面

6,ROS的安装https://wiki.ubuntu.com/ARM/RaspberryPi

7,其他待续

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值