b3lt3r
Posts: 21
Joined: Tue Jun 25, 2019 3:48 pm

Pi4 rootfs on SSD

Mon Dec 23, 2019 9:22 am

Hi

I believe that it's still necessary to perform the initial boot from SD and mount the SSD as root (I don't want to get into TFTP etc). Can someone please confirm/deny, and if correct, point me at the latest how-to guide for Pi4?

TIA

Mike

Kendek
Posts: 140
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Pi4 rootfs on SSD

Mon Dec 23, 2019 11:40 am

Yes it is still necessary.
After you download and unzip the .img file, you can mount the boot and rootfs partitions from it.
Under Ubuntu desktop:

Code: Select all

sudo -i
gnome-disk-image-mounter *raspbian-buster*.img
mkdir /mnt/{boot0,boot1,rootfs0,rootfs1}
mount /dev/loop0p1 /mnt/boot0
mount /dev/loop0p2 /mnt/rootfs0
Prepare the SD card:

Code: Select all

parted /dev/mmcblk0
mktable msdos
mkpart p 8192s 532479s
q
mkfs.fat -F 32 -n boot /dev/mmcblk0p1
mount /dev/mmcblk0p1 /mnt/boot1
and SSD:

Code: Select all

parted /dev/sdN
mktable gpt
mkpart p 1M 100%
q
mkfs.ext4 -L rootfs /dev/sdN1
mount /dev/sdN1 /mnt/rootfs1
Then copy the boot and rootfs contents to the SD and SSD:

Code: Select all

rsync -ah --progress /mnt/boot0/ /mnt/boot1
rsync -ah --progress /mnt/rootfs0/ /mnt/rootfs1
sync
and modify the cmdline.txt and fstab files:

Code: Select all

echo "console=serial0,115200 console=tty1 root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sdN1) rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet" >/mnt/boot1/cmdline.txt
echo -e "UUID=$(blkid -s UUID -o value /dev/sdN1)   /   ext4   defaults,noatime   0   1\nUUID=$(blkid -s UUID -o value /dev/mmcblk0p1)   /boot   vfat   defaults   0   2" >/mnt/rootfs1/etc/fstab
That's it, unmount the partitions and boot the Raspbian on the Pi.

Code: Select all

umount /mnt/*
rmdir /mnt/*
losetup -D

RonR
Posts: 783
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Pi4 rootfs on SSD

Mon Dec 23, 2019 7:23 pm

b3lt3r wrote:
Mon Dec 23, 2019 9:22 am
I believe that it's still necessary to perform the initial boot from SD and mount the SSD as root (I don't want to get into TFTP etc). Can someone please confirm/deny, and if correct, point me at the latest how-to guide for Pi4?

Running Raspbian from USB Devices : Made Easy

usb-boot will do it all for you.

Return to “Advanced users”