On the road again

The article describes the way to boot RaspberryPi 2 from USB HDD. SD card is used only for boot loader, the whole OS is on HDD which makes raspberry much more reliable.

Prepare card with fresh Raspbian image
Boot raspberry from newly created card
Connect USB drive
Check that USB drive is visible:
blkid
Copy rasbbian image to the booted system
Copy the second partition from image (linux ext4) to hdd, /dev/sda1 for instance. Use dd with offset:
fdisk -l image.img
dd if=image.img of=/dev/sda1 skip=start_value_for_second_partition_in_previous_fdisk_command
Check newly created fs:
e2fsck -f /dev/sda1
Resize newly created fs:
resize2fs /dev/sda1
Mount /dev/sda1:
mount /dev/sda1 /mnt
Change fstab on new FS:
vi /mnt/etc/fstab
remove /boot
change PARTUUID for rootfs (take from blkid command output)
Change root partition in SD card bootloader:
cd /boot
vi ./cmdline.txt
change root=PARTUUID=your_partuuid
Example:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=5218d05d-01 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait​
Reboot
Add comment