i wanted to maintain the portable nature of my PI4B so that is why i got the Samsung FIT, the thing is tiny and fast too!
hardwaremack-orginal wrote: ↑Sat Jul 13, 2019 5:39 pmi wanted to maintain the portable nature of my PI4B so that is why i got the Samsung FIT, the thing is tiny and fast too!
That guide seems unnecessarily complicated. I have a quick tutorial in this post.pagepack wrote: ↑Sat Jul 13, 2019 6:51 pmDid you have any joy? I bought exactly the same USB drive and followed this guide;
https://www.tomshardware.co.uk/boot-ras ... 61081.html
to no avail.
derekp wrote: ↑Tue Jul 09, 2019 11:39 pmIf you don't mind using the SD card for an initial boot loader, you can run the OS off a USB drive. Just edit the cmdline.txt in /boot, and add "init=/sbin/usbroot.sh", rsync the OS from the SD card to the usb drive, then create a script "/sbin/usbroot.sh" that mounts the usb, runs pivot_root, and then exec /sbin/init. Now you have the OS running of the usb drive, and the SD card is only in use while the system is initially booting.
If you want, I can put together details and write up a procedure in a separate post.
That's more complicated than it needs to be, and there's no need to "pivot_root".chriss44 wrote: ↑Thu Jul 18, 2019 6:19 pmderekp wrote: ↑Tue Jul 09, 2019 11:39 pmIf you don't mind using the SD card for an initial boot loader, you can run the OS off a USB drive. Just edit the cmdline.txt in /boot, and add "init=/sbin/usbroot.sh", rsync the OS from the SD card to the usb drive, then create a script "/sbin/usbroot.sh" that mounts the usb, runs pivot_root, and then exec /sbin/init. Now you have the OS running of the usb drive, and the SD card is only in use while the system is initially booting.
If you want, I can put together details and write up a procedure in a separate post.
![]()
![]()
I like your idea. I was always planning to boot the RPI4 from SSD - your idea seems to be a great solution to bridge the waiting time!
Did you try it on your RPI 4 - is it working?
Do you have a sample of usbroot.sh?
Thank you,
Chriss
Imaging the USB drive is the preferred way to do this, since it is also the easiest way to get USB boot working on BCM2837-based Pi's. It's also the method documented in the official documentation.
It's also ridiculously fast to image a USB 3.0 SSD, compared to any micro SD card (even in a USB 3.0 reader). Etcher flies through the write and verify process at almost comical speed when the SSD is on a USB 3.0 port.
Much simpler and less error-prone:HawaiianPi wrote: ↑Mon Jul 22, 2019 12:04 am
- Write a Raspbian Buster image to your USB drive with Etcher.
- Edit cmdline.txt on "boot" partition to remove the resize script launch (leave only a single space).
- Copy all files from USB drive "boot" partition to FAT32 micro SD card.
- Plug USB drive and card into Pi4 and boot it up.
- Edit /etc/fstab to mount the SD card as /boot, followed by a restart.
- Do basic configuration (change password, location, network, update, etc.).
- If you are using the Desktop version of Buster, install GParted and resize / partition to fill unallocated space on USB drive, then BEFORE YOU REBOOT, edit /boot/cmdline.txt and /etc/fstab with updated PARTUUID.
- For Buster Lite you could use another Raspbian card to resize the partition and edit the files.
Hi RonRRonR wrote: ↑Tue Jul 23, 2019 2:08 amMuch simpler and less error-prone:
1. Write a Raspbian Buster image to your USB drive with Etcher.
2. Write a Raspbian Buster image to an SD card with Etcher.
3. Plug the USB drive and SD card into Pi4 and boot it up.
4. Run usb-boot, answering 'No' to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX?'.
5. Reboot (the USB drive will boot).
6. Run raspi-config-usb, to resize the USB drive.
This post is a little clearer:Darktrax wrote: ↑Sat Jul 27, 2019 12:06 pmHi RonR
It did not work quite as expected for me.
I had Etcher write the SD with the latest Buster, and I did the apt upgrades.
The same for the USB SSD drive.
I fetched usb-boot, copied it to the Pi, and tried running usb-boot.
There was no opportunity for any dialogue. Just the briefest blink-flash, and it was gone!
No different when choosing "Run in terminal".
Code: Select all
chmod +x usb-boot
sudo ./usb-boot
Code: Select all
sudo shutdown -r now
Code: Select all
chmod +x raspi-config-usb
sudo ./raspi-config-usb
root@karo:~# fdisk -l|more
disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd9baabc9
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532480 524289 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 540672 62333951 61793280 29.5G 83 Linux
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: 100T2B0A-00SM50
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x0a477230
Device Boot Start End Sectors Size Id Type
/dev/sda1 65535 589814 524280 256M c W95 FAT32 (LBA)
/dev/sda2 589815 67697654 67107840 32G 83 Linux
/dev/sda3 67697655 76086134 8388480 4G 82 Linux swap / Solaris
/dev/sda4 76086135 1953525167 1877439033 895.2G 83 Linux
root@karo:~# mkfs -t vfat /dev/sda1
mkfs.fat 4.1 (2017-01-24)
root@karo:~# mkfs -t ext4 /dev/sda2
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 8388480 4k blocks and 2097152 inodes
Filesystem UUID: 7d8f26cd-2e9c-4b5b-84d5-cee147a34be8
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
root@karo:~# mkfs -t ext4 /dev/sda4
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 234679879 4k blocks and 58671104 inodes
root@karo:~# mount /dev/sda1 /mnt/boot/
root@karo:~# rsync -axHAWXS --numeric-ids --info=progress2 /boot /mnt
root@karo:~# mount /dev/sda2 /mnt/root/
root@karo:~# rsync -axHAWXS --numeric-ids --info=progress2 / /mnt/root
2,742,993,749 89% 22.39MB/s 0:01:56 (xfr#58784, to-chk=0/72686)
root@karo:~# mount /dev/sda4 /mnt/home/
root@karo:~# rsync -axHAWXS --numeric-ids --info=progress2 /home /mnt
root@karo:/mnt/root/home# rm -rf weberjn/
root@karo:/mnt/root/home# ll
total 0
root@karo:/mnt/root/etc# blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="F661-303B" TYPE="vfat" PARTUUID="d9baabc9-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="8d008fde-f12a-47f7-8519-197ea707d3d4" TYPE="ext4" PARTUUID="d9baabc9-02"
/dev/mmcblk0: PTUUID="d9baabc9" PTTYPE="dos"
/dev/sda1: SEC_TYPE="msdos" UUID="BA86-457C" TYPE="vfat" PARTUUID="0a477230-01"
/dev/sda2: UUID="7d8f26cd-2e9c-4b5b-84d5-cee147a34be8" TYPE="ext4" PARTUUID="0a477230-02"
/dev/sda3: PARTUUID="0a477230-03"
/dev/sda4: UUID="901daf85-0613-4908-9276-c33b0483a30a" TYPE="ext4" PARTUUID="0a477230-04"
root@karo:~# cat /mnt/root/etc/fstab
proc /proc proc defaults 0 0
PARTUUID=d9baabc9-01 /boot vfat defaults 0 2
PARTUUID=0a477230-02 / ext4 defaults,noatime 0 1
PARTUUID=0a477230-04 /home ext4 defaults,noatime 0 1
root@karo:/boot# cat cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=0a477230-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
root@karo:~# reboot
weberjn@karo:~ $ df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/root ext4 32G 2.6G 28G 9% /
devtmpfs devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs tmpfs 2.0G 8.5M 1.9G 1% /run
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs tmpfs 2.0G 0 2.0G 0% /tmp
/dev/mmcblk0p1 vfat 253M 40M 213M 16% /boot
/dev/sda4 ext4 881G 153M 836G 1% /home
tmpfs tmpfs 391M 0 391M 0% /run/user/1001
You no doubt hit the return key with nothing selected the first time. 'whiptail' (the program that does the semi-gui looking interface) returns as if you hit the escape (abort) key in this case. 'whiptail' is pretty lacking.
Simply running 'mount' will confirm that: '/dev/sda2 on /'.
I'm pleased to hear of your success.
That's great if know how to manipulate all those commands, but usb-boot does all that for you by simply typing 'sudo ./usb-boot'.weberjn wrote: ↑Sun Jul 28, 2019 10:56 amI just set up my Pi 4 to boot from SD to a WD blue SSD w SATA2USB adapter, using just the command line:
- fdisk the partitions (boot, root, home) as primary partitions
mkfs
mount and rsync the SD to SSD
add the PARTUUIDs to the fstab on the SSD
point the SD cmdline.txt to the SSD root
Hi, i have try your method but my Raspi4 don't boot to USB Storage (SSD) :/RonR wrote: ↑Tue Jul 23, 2019 2:08 amMuch simpler and less error-prone:
1. Write a Raspbian Buster image to your USB drive with Etcher.
2. Write a Raspbian Buster image to an SD card with Etcher.
3. Plug the USB drive and SD card into Pi4 and boot it up.
4. Run usb-boot, answering 'No' to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX?'.
5. Reboot (the USB drive will boot).
M4dm4rtig4n wrote: ↑Mon Aug 19, 2019 11:47 pmHi, i have try your method but my Raspi4 don't boot to USB Storage (SSD) :/RonR wrote: ↑Tue Jul 23, 2019 2:08 amMuch simpler and less error-prone:
1. Write a Raspbian Buster image to your USB drive with Etcher.
2. Write a Raspbian Buster image to an SD card with Etcher.
3. Plug the USB drive and SD card into Pi4 and boot it up.
4. Run usb-boot, answering 'No' to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX?'.
5. Reboot (the USB drive will boot).
How do you know it's not running the OS from USB?M4dm4rtig4n wrote: ↑Mon Aug 19, 2019 11:47 pmHi, i have try your method but my Raspi4 don't boot to USB Storage (SSD) :/