v1mv
Posts: 2
Joined: Wed May 20, 2020 8:08 pm

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Wed May 20, 2020 8:30 pm

Hi all, am I only one with this trouble?
I did all the steps to boot from SSD on my Pi 4. When I'm trying to boot from SSD, the lights on my USB 3.0 pocket even not blinking and my Pi 4 gives me a message "no SD found" and trying boot from LAN. The lights on my USB pocket start blinking when the SD cart starts loading the system. And yes, I use 'quirks'. The same on USB 2.0 ports.

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Thu May 21, 2020 4:23 am

v1mv wrote:
Wed May 20, 2020 8:30 pm
Hi all, am I only one with this trouble?
I did all the steps to boot from SSD on my Pi 4. When I'm trying to boot from SSD, the lights on my USB 3.0 pocket even not blinking and my Pi 4 gives me a message "no SD found" and trying boot from LAN. The lights on my USB pocket start blinking when the SD cart starts loading the system. And yes, I use 'quirks'. The same on USB 2.0 ports.
Are you trying to boot without SD card (message "no SD found")? That's not possible right now on a RPi 4 (an alpha version of USB boot is coming soon).

This thread is about a "mixed" boot process which will work on every RPi: boot sector on SD and root file system on USB. Obviously you did not read the first post in this thread.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

v1mv
Posts: 2
Joined: Wed May 20, 2020 8:08 pm

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Thu May 21, 2020 6:12 am

gkreidl wrote:
Thu May 21, 2020 4:23 am
v1mv wrote:
Wed May 20, 2020 8:30 pm
Hi all, am I only one with this trouble?
I did all the steps to boot from SSD on my Pi 4. When I'm trying to boot from SSD, the lights on my USB 3.0 pocket even not blinking and my Pi 4 gives me a message "no SD found" and trying boot from LAN. The lights on my USB pocket start blinking when the SD cart starts loading the system. And yes, I use 'quirks'. The same on USB 2.0 ports.
Are you trying to boot without SD card (message "no SD found")? That's not possible right now on a RPi 4 (an alpha version of USB boot is coming soon).

This thread is about a "mixed" boot process which will work on every RPi: boot sector on SD and root file system on USB. Obviously you did not read the first post in this thread.
https://youtu.be/AskGItLhESk

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Thu May 21, 2020 10:10 am

v1mv wrote:
Thu May 21, 2020 6:12 am
https://youtu.be/AskGItLhESk
Then you are posting in the wrong thread.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Stephenxyx
Posts: 1
Joined: Thu Dec 29, 2016 2:14 pm

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Thu May 28, 2020 12:26 am

mxrider108 wrote:
Mon May 11, 2020 6:23 pm
messypotamia,

Thanks for the reply. One question: how do I read the

Code: Select all

dmesg
logs if I can't even SSH or access the system anymore? On reboot those logs seem to be gone. :roll: Edit: I'm going to try running the PI off the SD card with the USB 3.1 device just mounted to the filesystem as a normal external drive, and then see if it will eventually trigger the issue so I can actually check dmesg without the system crashing as well.

Very sad to hear that USB 3.1 doesn't work well with the PI 4... I wonder if doing something like the quirks mode described in this sticky would potentially help resolve the issue? I haven't tried that yet.

I also have a powered USB hub coming via Amazon as I've read a few places mentioning USB flakiness could be due to the amount of power needed... I would assume a solid state flash drive would not exceed limits, but I figure it's worth a shot.

Question for the thread: has anyone else experienced issues with USB 3.1? If so is there any way to force the 3.1 device to operate via USB 3 or USB 2 instead?
Although I could get my Pi4 to boot from a 3.0 USB stick, performance was terrible and unusable. After seeing the potential USB 3 problem mentioned in this thread, I cloned my USB 3 data to a USB 2.0 stick and lo and behold all is working well now. FWIW, I used the below link below to set up my USB stick for USB booting, and given my ignorance about PCs, I somehow got the Pi via USB working well. So it does appear USB 3 on Pi 4 needs some fixing.

https://www.tomshardware.com/how-to/boo ... y-pi-4-usb

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Thu May 28, 2020 4:05 am

Stephenxyx wrote:
Thu May 28, 2020 12:26 am

Although I could get my Pi4 to boot from a 3.0 USB stick, performance was terrible and unusable. After seeing the potential USB 3 problem mentioned in this thread, I cloned my USB 3 data to a USB 2.0 stick and lo and behold all is working well now. FWIW, I used the below link below to set up my USB stick for USB booting, and given my ignorance about PCs, I somehow got the Pi via USB working well. So it does appear USB 3 on Pi 4 needs some fixing.

https://www.tomshardware.com/how-to/boo ... y-pi-4-usb
You are definitely posting in the wrong thread:

1) This thread describes a hybrid mode of USB booting (boot sector on SD card, root file system on USB media), which works on all RPis.

2) You are using a beta version of boot code and firmware which has only been published for testing by experienced users, which the linked article forgets to mention.

3) Befor you start using any USB3 device for booting, you should make sure it properly supports UAS and if not, add a quirk to avoid UAS to the command line.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

bjoernb
Posts: 4
Joined: Mon Aug 26, 2013 11:07 am

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Sat Jun 06, 2020 1:44 pm

I have had this setup now for several weeks running perfectly on my Raspberry Pi 4. I followed the instructions in the first post, but did not read all the following details of the other 16 pages, since I'm slightly panicking right now.

I just updated to the latest everything via apt and rebooted and now docker won't start anymore. The USB Harddisk is still found, my data still seams to be there, but I'm missing for instance /boot/cmdline.txt?? I thought the modules might be out of sync and wanted to switch back to the SD card, but can't, since I can't find the cmdline.txt...

I tried to run rpi-update, but it also fails, since /dev/root is not a block device. config.txt is also empty.

uname -r: 4.19.97-v7l+
ls /lib/modules: 4.19.118+ 4.19.118-v7+ 4.19.118-v7l+ 4.19.118-v8+

Do I just have to read remaining 16 packages and everything will reveal itself to me or is this something new? Or is it completely unrelated to the USB storage and another issue?

Thanks for any hint.

Solved, sort of. So after restoring the config.txt and commandline.txt, I realized that I had not properly followed the manual and also commented out the boot section from the SD card. I corrected all of that, could then switch to booting from the SD card. I updated the system also there to the latest, switched back to USB, did another sudo apt install --reinstall raspberrypi-bootloader raspberrypi-kernel and now everything is working fine again. uname -r now also shows 4.19.118-v7l+.

Ants
Posts: 9
Joined: Sat Mar 26, 2016 1:11 am

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Thu Jun 11, 2020 5:35 am

Big thanks to paulv for these detailed instructions and for keeping them up to date. I just thought I'd add a few notes that might help others solve problems like I had. I have now completed this on a pi4 and pi3, both on buster, and a zeroW running stretch 9.

I did have some issues with missing PARTUUID for sda1 and sda2 using fdisk. Sometimes re-partitioning and reformatting the USB with a single partition helped, but I had particular trouble with the zeroW. In the end I used parted to create the partitions and then followed the rest of the instructions as normal.

I tried searching the rest of the 16 pages in this thread but couldn't find anything until after I had had success with parted and then searched for that. Perhaps a note could be placed in the instructions there?

All of my pi's are headless so perhaps also a note rebooting taking longer than normal after updating the root filesystem (sudo nano /mnt/etc/fstab) as I thought it had failed the first few times and didn't wait long enough before removing the SD and modding the /boot/cmdline.txt to try again.

paulv
Posts: 563
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Fri Jun 12, 2020 9:02 am

Thank you Ants for reporting this. I'll update the post and add a heads-up.

jimbojones
Posts: 20
Joined: Sun Apr 15, 2018 2:33 pm

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Sun Jun 21, 2020 4:19 pm

Hi. Just want to start off by saying that this is great guide, with excellent instructions. Thank you, paulv, for the excellent work and the effort put in to continually updating it :D

I am having a problem though. I have used this guide twice on two different Pi’s, both 3B+, with very similar set-ups (hence I can’t work out why it went wrong on the second). First one went fine with no problems.

But on my 2nd Pi, it can no longer auto-mount when booted on the external USB drive.
The rootfs on the SD Card is not automounted, and neither are the other partitions of the external drive.

This problem does not exist on the 1st Pi I did this on. On both Pi’s, I performed this using brand new installations of Raspberry Pi OS Desktop.

I believe there is an issue creating the directories in the /media/ folder. According to GParted and the File Explorer window, all partitions are mounted in the respective directories in /media/, but when trying to access them I get an error saying (for one example)

Code: Select all

The specified directory ‘/media/pi/Seagate‘ is not valid
and when navigating to /media/pi/ there are no corresponding directories as there should be.

Like I said, I did this exact same thing on another Pi using the exact same setup and the same external drive, and on that Pi I do not see this issue. On the 2nd Pi with the problem, when I switch back to booting up from the SD card root partition, automount works again, and the directories are in /media/

I know I could get round this by creating fstab entries, but that’s not only inconvenient for quickly plugging in usb drives, but I really want to get to the bottom of why this is happening.

jimbojones
Posts: 20
Joined: Sun Apr 15, 2018 2:33 pm

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Sun Jun 21, 2020 5:22 pm

jimbojones wrote:
Sun Jun 21, 2020 4:19 pm
Hi. Just want to start off by saying that this is great guide, with excellent instructions. Thank you, paulv, for the excellent work and the effort put in to continually updating it :D

I am having a problem....
I just want to follow up and say I went and removed the partition on the USB drive and reformatted it, and then performed the rsync again.

Still not working. I boot into the SD Card rootfs, everything is automounted. Switch to USB rootfs, nothing is automounted properly and I get the directory invalid error. Very strange as I thought maybe it had been an issue with the rsync. Should I create a new thread for this problem?

EDIT:

Ok, I have made some progress in working out what is happening. I believe it is something to do with the permissions of the pi user to create automounts when starting the Desktop, as when logging into the Desktop as root, all the partitions automount correctly. What is weird is that this is not happening from the SD Card rootfs, only the external USB rootfs, and it weird that it worked ok on my other pi :/ Any ideas? I might just star all over again from scratch and see if that works
Last edited by jimbojones on Sun Jun 21, 2020 7:29 pm, edited 1 time in total.

jimbojones
Posts: 20
Joined: Sun Apr 15, 2018 2:33 pm

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Sun Jun 21, 2020 7:27 pm

Ok, I managed to solve this on my own, but just in case someone else with the same problem stumbles upon this (and also probably worth everyone here knowing regardless): it was indeed a permissions issue.

I restarted from scratch with a new Pi image, but same exact problem as before. Automounting works on the original SD Card rootfs installation, but not on the external USB rootfs.

Finally figured out that for some reason during the rsync the /media/pi/ directory gets its ownership changed to root root, instead of pi pi. This seems like a big problem, but what I don’t understand is why no one else here has come across this problem before, and indeed why I didn’t come across it myself when I’ve already done this same process on another pi? What about the rsync command am I doing differently that permissions aren’t honoured? :/

Anyway, removing the /media/pi directory and rebooting solved it, as it was automatically re-created upon boot and all partitions were automounted correctly :D

I just hope there aren’t other weird permission issues elsewhere in the system :/

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Sun Jun 21, 2020 8:59 pm

@jimjobones: I have created at least 6 installations using this method and had never any permission problems. Maybe you used rsync with a wrong set of options.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jimbojones
Posts: 20
Joined: Sun Apr 15, 2018 2:33 pm

Re: STICKY: HOWTO: Move the filesystem to a USB stick/Drive

Mon Jun 22, 2020 9:02 am

@ gkreidl No, that isn’t it. I booted back into the SD card interface and checked my bash history, just to make sure, and I definitely used the correct command

Code: Select all

sudo rsync -axv / /mnt

Return to “Advanced users”