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

Re: Running Raspbian from USB Devices : Made Easy

Thu Mar 05, 2020 6:44 pm

royhenderson wrote:
Thu Mar 05, 2020 10:33 am
It looks like the script automatically generates PARTUUIDs which (most probably) will be unique.

That's the behaviour I would want, is that assumption correct?

PARTUUID's need to be unique on all devices (which as of Raspbian Buster is less likely to be the case). usb-boot verifies there is no duplication.

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

Re: Running Raspbian from USB Devices : Made Easy

Thu Mar 05, 2020 6:49 pm

tw99 wrote:
Thu Mar 05, 2020 12:57 pm
The only issue I had was that my fstab included a line to mount another USB drive at /dev/sda , and at some point during the process, the device numbering changed so that drive became /dev/sdb. I just needed to change the fstab to use PARTUUID when mounting, to make this independent of device naming.

You should always use PARTUUID notation instead of /dev/sdX notation to avoid such conflicts. usb-boot uses PARTUUID notation to ensure the correct device is booted.

RTouris
Posts: 7
Joined: Mon Nov 18, 2019 7:18 pm

Re: Running Raspbian from USB Devices : Made Easy

Sat Mar 14, 2020 7:24 pm

About a fortnight ago I migrated a fresh raspbian installation on a RPi4B from an SD card to a USB SSD drive via usb-boot with what appeared to be no issues to begin with. However after a few days and upon the latest official atheros / broadcom fw updates i got the 4 blinking grenn leds at boot..Pi is / was running on gigabit ethernet with fixed IP settings. Anything i can quickly check on the SD config seeing that I'm pretty new to all this except reverting to a new installation and starting the procedure all over again? I'm reading things about a corrupt file at boot, but I can't see why this would happen as the SMB server was running with no issues and no particular traffic quite happily for a few days with no issues to report.

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

Re: Running Raspbian from USB Devices : Made Easy

Sun Mar 15, 2020 5:09 am

RTouris wrote:
Sat Mar 14, 2020 7:24 pm
About a fortnight ago I migrated a fresh raspbian installation on a RPi4B from an SD card to a USB SSD drive via usb-boot with what appeared to be no issues to begin with. However after a few days and upon the latest official atheros / broadcom fw updates i got the 4 blinking grenn leds at boot..Pi is / was running on gigabit ethernet with fixed IP settings. Anything i can quickly check on the SD config seeing that I'm pretty new to all this except reverting to a new installation and starting the procedure all over again? I'm reading things about a corrupt file at boot, but I can't see why this would happen as the SMB server was running with no issues and no particular traffic quite happily for a few days with no issues to report.

You can create a fresh SD card, boot it, update it, and run 'fsck -f' on the SSD to see if the SSD's filesystem is intact. Then you can run usb-boot from the new SD card, answering 'No' to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX?. If the SSD still won't run, there are probably corrupted files on it.

Brad Q
Posts: 102
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian from USB Devices : Made Easy

Sun Mar 15, 2020 1:19 pm

Ron
This probably me just missing something along the way.

I normally keep the WiFi shut off (Ethernet guy) but I needed to use it the other day. Other than pulling the SD card and editing it on another computer, how do I change the config file on the SD card? It took me a while(longer than I care to admit) to realize I was changing the copy on the USB stick rather than the copy on the SD card.

RTouris
Posts: 7
Joined: Mon Nov 18, 2019 7:18 pm

Re: Running Raspbian from USB Devices : Made Easy

Sun Mar 15, 2020 2:16 pm

RonR wrote:
Sun Mar 15, 2020 5:09 am
RTouris wrote:
Sat Mar 14, 2020 7:24 pm
About a fortnight ago I migrated a fresh raspbian installation on a RPi4B from an SD card to a USB SSD drive via usb-boot with what appeared to be no issues to begin with. However after a few days and upon the latest official atheros / broadcom fw updates i got the 4 blinking grenn leds at boot..Pi is / was running on gigabit ethernet with fixed IP settings. Anything i can quickly check on the SD config seeing that I'm pretty new to all this except reverting to a new installation and starting the procedure all over again? I'm reading things about a corrupt file at boot, but I can't see why this would happen as the SMB server was running with no issues and no particular traffic quite happily for a few days with no issues to report.

You can create a fresh SD card, boot it, update it, and run 'fsck -f' on the SSD to see if the SSD's filesystem is intact. Then you can run usb-boot from the new SD card, answering 'No' to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX?. If the SSD still won't run, there are probably corrupted files on it.
Thanks for the reply, currently missing the required hardware to do so (sd reader & previous monitor are currently unavailable for testing as I moved the server to alt. location after setting up) as current setup was running headless in vnc - so i guess it'll have to wait until i can get these issues sorted first. How would i go about configuring the new setup in the SD fresh installation to automatically enable the vnc server, ssh and assign a fixed IP since i probably won't be able to hook up an external monitor to it though?

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

Re: Running Raspbian from USB Devices : Made Easy

Sun Mar 15, 2020 9:23 pm

Brad Q wrote:
Sun Mar 15, 2020 1:19 pm
I normally keep the WiFi shut off (Ethernet guy) but I needed to use it the other day. Other than pulling the SD card and editing it on another computer, how do I change the config file on the SD card? It took me a while(longer than I care to admit) to realize I was changing the copy on the USB stick rather than the copy on the SD card.

usb-boot configures /boot to be the boot partition on the SD card, so accessing /boot/config.txt should be getting you the corrrect file.

The boot partition on the USB device isn't mounted anywhere, so it isn't normally accessible or used for anything.

sdc-boot will allow you to boot the SD card instead of the USB device should you have a need to do so:

Code: Select all

sdc-boot /dev/mmcblk0

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

Re: Running Raspbian from USB Devices : Made Easy

Sun Mar 15, 2020 9:30 pm

RTouris wrote:
Sun Mar 15, 2020 2:16 pm
How would i go about configuring the new setup in the SD fresh installation to automatically enable the vnc server, ssh and assign a fixed IP since i probably won't be able to hook up an external monitor to it though?

You configure things the same way using a USB device as you would using an SD card.

User avatar
butchkemper
Posts: 43
Joined: Sat Jul 22, 2017 8:03 pm
Location: Sachse, Texas USA

Re: Running Raspbian from USB Devices : Made Easy

Sat Mar 21, 2020 3:50 am

I spent yesterday evening reading the 10 page thread and then gathered all the pieces I would need boot the Pi from an SSD. Here is how today went:
  • Used Etcher on W10 to load RetroPi image on the SDHC.
  • Added to the boot directory a ssh.txt file, updated config.txt with the magic runes necessary for my RPi3B2v1.2 boot process to overcome an OTP error, and copied over the USB-SCRIPTS.
  • Placed the SDHC in the Pi, connected the SSD, and powered on.
  • The system booted, I logged in as Pi, executed the usb-boot script. and got an error that the SSD was mounted.
  • Unmounted the SSD, executed the usb-script, and again got the error that the SSD was mounted.
  • Unmounted the SSD, renamed the mount point from /media to /Xmedia, executed the usb-script, and all went well.
  • Renamed the mount point /Xmedia back to /media and rebooted.
  • The system loaded from the SSD, displayed the RetroPi splash screen, then unexpectedly rebooted, and then came up.
  • Ran apt-get to update/upgrade Raspbian and then completed the RetroPi setup/update.
This took most of the day as many false starts required several rebuilds of the SDHC and then the SSD. Somehow during the mount point fiddling, I managed to lose the entire / directory contents which required another SSD rebuild.

The system is now running quite nicely and boots really fast. Thank you RonR for the effort to write and debug the scripts..

Regards,

Butch

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

Re: Running Raspbian from USB Devices : Made Easy

Sat Mar 21, 2020 6:25 am

butchkemper wrote:
Sat Mar 21, 2020 3:50 am
  • The system booted, I logged in as Pi, executed the usb-boot script. and got an error that the SSD was mounted.
  • Unmounted the SSD, executed the usb-script, and again got the error that the SSD was mounted.
  • Unmounted the SSD, renamed the mount point from /media to /Xmedia, executed the usb-script, and all went well.
  • Renamed the mount point /Xmedia back to /media and rebooted.

I suspect there were multiple partitions on the SSD and you didn't get them all unmounted on the first try. You shouldn't have needed to rename /media.
butchkemper wrote:
Sat Mar 21, 2020 3:50 am
  • The system loaded from the SSD, displayed the RetroPi splash screen, then unexpectedly rebooted, and then came up.

The reboot was expected in order to expand the filesystem to make use of the entire SSD.
butchkemper wrote:
Sat Mar 21, 2020 3:50 am
This took most of the day as many false starts required several rebuilds of the SDHC and then the SSD. Somehow during the mount point fiddling, I managed to lose the entire / directory contents which required another SSD rebuild.

The system is now running quite nicely and boots really fast. Thank you RonR for the effort to write and debug the scripts..

I'm sorry the experience took so long. It normally takes only a couple of minutes (other than the time required to copy the SD card to the SSD) to get up and running on an SSD. I hope it's smooth sailing from here on.

10der
Posts: 2
Joined: Fri Jul 01, 2016 7:00 pm

Re: Running Raspbian from USB Devices : Made Easy

Sat Mar 21, 2020 5:13 pm

Hi!

just for fun - but crazy!

1) found the old SD card from old canon photo camera (512mb)
2) format F: (yes am win user)
3) copy via Far command SFTP boot dir from rpi to new formated 512m card (done)
4) remove 64Gb card and insert as a new (no - too old (sic!)) card to rPi
5) wow! rpi loaded succ

profit! :) thank and author, God bless!

tassau
Posts: 6
Joined: Wed Jul 18, 2018 10:54 pm

Re: Running Raspbian from USB Devices : Made Easy

Sat Mar 21, 2020 9:10 pm

2 years ago, using usb-boot, I moved the Raspbian to USB. Everything works, but now I would like to reverse the situation: move the current version of Raspbian with all changes from USB to SD. All I know is that to boot from SD I have to change in cmdline.txt file "root=/dev/mmcblk0p2", but how to transfer everything from USB to SD?

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

Re: Running Raspbian from USB Devices : Made Easy

Sat Mar 21, 2020 9:40 pm

tassau wrote:
Sat Mar 21, 2020 9:10 pm
2 years ago, using usb-boot, I moved the Raspbian to USB. Everything works, but now I would like to reverse the situation: move the current version of Raspbian with all changes from USB to SD. All I know is that to boot from SD I have to change in cmdline.txt file "root=/dev/mmcblk0p2", but how to transfer everything from USB to SD?

Simply make a backup using image-backup, write that backup to an SD card, and you should be good to go.

underwriter
Posts: 2
Joined: Sun Mar 22, 2020 2:03 pm

Re: Running Raspbian from USB Devices : Made Easy

Sun Mar 22, 2020 4:50 pm

A newbie here so forgive me for asking if it's been asked before:
1) If I download this file for RP4 to boot from ssd:
2) Where do I add it, SD card or SSD?
3) Add to root or where?
4) How do I expand the ssd to use completely the remaining space?
5) If I instal Openmediavault on top of Raspbian after making the changes, would the system files still be saved on SSD or does it default back to SD card?
Thanks for your patience and help
Last edited by underwriter on Mon Mar 23, 2020 3:14 am, edited 1 time in total.

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

Re: Running Raspbian from USB Devices : Made Easy

Sun Mar 22, 2020 9:18 pm

underwriter wrote:
Sun Mar 22, 2020 4:50 pm
If I download this file for RP4 to boot from ssd:
Where do I add it, SD card or SSD?
Add to root or where?

Simply unzip the contents of usb-boot.zip to the location of your choice on your SD card. Then run:

Code: Select all

chmod +x usb-boot
sudo ./usb-boot
underwriter wrote:
Sun Mar 22, 2020 4:50 pm
How do I expand the ssd to use completely the remaining space?

Once usb-boot completes and you reboot, Raspbian will be auto-expanded to use all available space on the SSD. Be patient, as an automatic reboot takes place during this process.
underwriter wrote:
Sun Mar 22, 2020 4:50 pm
If I instal Openmediavault on top of Raspbian after making the changes, would the system files still be saved on SSD or does it default back to SD card?

Once you're running from the SSD, almost all changes occur on the SSD. Only changes to /boot (such as a Raspbian update) will occur on the SD card.

underwriter
Posts: 2
Joined: Sun Mar 22, 2020 2:03 pm

Re: Running Raspbian from USB Devices : Made Easy

Mon Mar 23, 2020 3:16 am

Thanks for the simplification #RonR. I truly appreciate that and your work.

razmoket89
Posts: 3
Joined: Fri Mar 27, 2020 1:08 am
Location: France

Re: Running Raspbian from USB Devices : Made Easy

Fri Mar 27, 2020 1:13 am

Hi.

Thank's, it was working like a charm, despite the fact that i was a total noob to linux.

But today, i tried to add an nfs share into /etc/fstab and it got me stuck into emergency mode.

I found a procedure with" mount -o remount,rw /" but it's getting me an error : mount: /: can't find PARTUUID=b74a1edf-02

As far as I understood, iIneed to mount in RW, so i can edit the fstab and remove that fu***** line, and the nit's gonna be back to normal.

Any lead ?

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

Re: Running Raspbian from USB Devices : Made Easy

Fri Mar 27, 2020 5:44 pm

razmoket89 wrote:
Fri Mar 27, 2020 1:13 am
Thank's, it was working like a charm, despite the fact that i was a total noob to linux.

But today, i tried to add an nfs share into /etc/fstab and it got me stuck into emergency mode.

I found a procedure with" mount -o remount,rw /" but it's getting me an error : mount: /: can't find PARTUUID=b74a1edf-02

As far as I understood, iIneed to mount in RW, so i can edit the fstab and remove that fu***** line, and the nit's gonna be back to normal.

Any lead ?

Adding an nfs share should not involve making a change to the '/' line in fstab.

You should revert fstab back to its original condition and revisit the subject.

razmoket89
Posts: 3
Joined: Fri Mar 27, 2020 1:08 am
Location: France

Re: Running Raspbian from USB Devices : Made Easy

Fri Mar 27, 2020 6:35 pm

RonR wrote:
Fri Mar 27, 2020 5:44 pm
razmoket89 wrote:
Fri Mar 27, 2020 1:13 am
Thank's, it was working like a charm, despite the fact that i was a total noob to linux.

But today, i tried to add an nfs share into /etc/fstab and it got me stuck into emergency mode.

I found a procedure with" mount -o remount,rw /" but it's getting me an error : mount: /: can't find PARTUUID=b74a1edf-02

As far as I understood, iIneed to mount in RW, so i can edit the fstab and remove that fu***** line, and the nit's gonna be back to normal.

Any lead ?

Adding an nfs share should not involve making a change to the '/' line in fstab.

You should revert fstab back to its original condition and revisit the subject.
I'd love to get back to myfstab orignal condition, but how do i do since system won't boot.

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

Re: Running Raspbian from USB Devices : Made Easy

Fri Mar 27, 2020 6:42 pm

razmoket89 wrote:
Fri Mar 27, 2020 6:35 pm
I'd love to get back to myfstab orignal condition, but how do i do since system won't boot.

You can bring up a new/minimal system on another SD card (Lite + SSH is all you need) and mount your broken system in order to restore its fstab.

razmoket89
Posts: 3
Joined: Fri Mar 27, 2020 1:08 am
Location: France

Re: Running Raspbian from USB Devices : Made Easy

Fri Mar 27, 2020 11:08 pm

RonR wrote:
Fri Mar 27, 2020 6:42 pm
razmoket89 wrote:
Fri Mar 27, 2020 6:35 pm
I'd love to get back to myfstab orignal condition, but how do i do since system won't boot.

You can bring up a new/minimal system on another SD card (Lite + SSH is all you need) and mount your broken system in order to restore its fstab.
Thanks, that worked ! I'm back on it and learning step by step :)

Thanks again.

scaramonga
Posts: 49
Joined: Sat Jul 13, 2019 4:08 am

Re: Running Raspbian from USB Devices : Made Easy

Thu Apr 23, 2020 5:08 pm

Is there any way to stop the script from taking over the whole drive. aka, resizing it all to fit? I'm wanting to resize and create another partition on same drive after all is set up (1Tb SSD). OMV will not let me use the rest of drive for anything else as it seems locked in after using script.

Any help appreciated.

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

Re: Running Raspbian from USB Devices : Made Easy

Fri Apr 24, 2020 3:05 am

scaramonga wrote:
Thu Apr 23, 2020 5:08 pm
Is there any way to stop the script from taking over the whole drive. aka, resizing it all to fit? I'm wanting to resize and create another partition on same drive after all is set up (1Tb SSD). OMV will not let me use the rest of drive for anything else as it seems locked in after using script.

Nothing should be 'locked in' after using usb-boot. You should be able to repartition the disk normally.

I don't know what OMV is so, I can't offer any suggestions.

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

Re: Running Raspbian from USB Devices : Made Easy

Fri Apr 24, 2020 3:12 am

usb-boot (in the first post of this topic) has been updated.

usb-boot now supports booting drives larger than 2TB using GPT partition tables. Smaller drives and SD cards can also use GPT partition tables if desired.

For existing systems, mbr2gpt converts an MBR partition table on a USB device to a GPT partition table, as well as optionally expanding the ROOT partition and enabling booting via an SD card.

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

Re: Running Raspbian from USB Devices : Made Easy

Fri Apr 24, 2020 5:59 am

RonR wrote:
Fri Apr 24, 2020 3:05 am
scaramonga wrote:
Thu Apr 23, 2020 5:08 pm
Is there any way to stop the script from taking over the whole drive. aka, resizing it all to fit? I'm wanting to resize and create another partition on same drive after all is set up (1Tb SSD). OMV will not let me use the rest of drive for anything else as it seems locked in after using script.

Nothing should be 'locked in' after using usb-boot. You should be able to repartition the disk normally.

I don't know what OMV is so, I can't offer any suggestions.

If OMV happens to be OpenMediaVault, I was able to successfully install and run it on a system created by usb-boot using the instructions found in: Installing OMV5 On a Raspberry PI

No extra partition or anything special was needed. All I did was run:

Code: Select all

wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash

After a reboot, I could log in and everything appeared to be ready to go (I didn't actually try to configure and use it).

I hope that helps.

Return to “Advanced users”