Re: Running Raspbian from USB Devices : Made Easy
Hello everyone,
so I was made aware of your script and think it might solve some of my issues :)
I cannot directly boot from my SSD because it has a block size of 4096 instead of 512. Will this script still work despite this? I think it should, but I just want to make sure :)
When using the script, will the two partitions (boot and actual system) be separated or will both SDCard and SSD have the same boot & system partitions but SD only uses boot and SSD only uses system?
Depending on the answer, how do updates work? If I update or upgrade the system, will only one of the two be updated?
What about backups? I try to create a backup of my SDCard once a month because I am running my Home Assistant server on my RPi and I want to make sure that I have all data in case of a crash. Would I need to keep to backup copies then? One of the SDCard and one of the SSD?
Thank you for your help :)
Alex
so I was made aware of your script and think it might solve some of my issues :)
I cannot directly boot from my SSD because it has a block size of 4096 instead of 512. Will this script still work despite this? I think it should, but I just want to make sure :)
When using the script, will the two partitions (boot and actual system) be separated or will both SDCard and SSD have the same boot & system partitions but SD only uses boot and SSD only uses system?
Depending on the answer, how do updates work? If I update or upgrade the system, will only one of the two be updated?
What about backups? I try to create a backup of my SDCard once a month because I am running my Home Assistant server on my RPi and I want to make sure that I have all data in case of a crash. Would I need to keep to backup copies then? One of the SDCard and one of the SSD?
Thank you for your help :)
Alex
Re: Running Raspbian from USB Devices : Made Easy
@AleXSR700,
Hybrid booting has been one of the most popular ways of booting USB devices for many years on all Raspberry Pi's (including the Raspberry Pi 4B prior to its current EEPROM USB support being developed). This script has been successfully used on thousands of Raspberry Pi's. The only way to know if Hybrid booting will work on your USB SSD with 4K sectors is to try it. Make a copy of your SD Card in case there are any surprises.
Hybrid booting has been one of the most popular ways of booting USB devices for many years on all Raspberry Pi's (including the Raspberry Pi 4B prior to its current EEPROM USB support being developed). This script has been successfully used on thousands of Raspberry Pi's. The only way to know if Hybrid booting will work on your USB SSD with 4K sectors is to try it. Make a copy of your SD Card in case there are any surprises.
Re: Running Raspbian from USB Devices : Made Easy
SSDs with block size of 4096 are rare. Samsung, ADATA, Hynix, WD, Seagate all have 512.
Sabrent is one I know of and they offer a utility to set the block size 512 or 4096.
I set mine to 512 and run Raspberry Pi OS and Manjaro from it just fine.
If your RPi has the latest EEPROM you can burn your preferred image directly to the SSD, no SD card needed.
Sabrent is one I know of and they offer a utility to set the block size 512 or 4096.
I set mine to 512 and run Raspberry Pi OS and Manjaro from it just fine.
If your RPi has the latest EEPROM you can burn your preferred image directly to the SSD, no SD card needed.
Re: Running Raspbian from USB Devices : Made Easy
I just found out that in fact not the SSD has a block size of 4096 but rather the case reported 4096. I now switched the case.
Could you maybe tell me about backing up? Would I then need to create a backup of the SDcard and the SSD everytime I want to run the backup? Or is the boot partition a one-time backup?
What about updates? Are both updated or are all updates only ever on the SSD?
Could you maybe tell me about backing up? Would I then need to create a backup of the SDcard and the SSD everytime I want to run the backup? Or is the boot partition a one-time backup?
What about updates? Are both updated or are all updates only ever on the SSD?
Re: Running Raspbian from USB Devices : Made Easy
Hello everyone,
quick question: I am creating a backup using Image File Utilities ( viewtopic.php?f=29&t=247568 ) and was wondering if this will work properly also for a USB setup and how to restore it. Would I then restore the backup once to the SDCard and once to the SSD?
Each storage is only responsible for one of the two partitions after all.
quick question: I am creating a backup using Image File Utilities ( viewtopic.php?f=29&t=247568 ) and was wondering if this will work properly also for a USB setup and how to restore it. Would I then restore the backup once to the SDCard and once to the SSD?
Each storage is only responsible for one of the two partitions after all.
Re: Running Raspbian from USB Devices : Made Easy
AleXSR700 wrote: ↑Thu Jun 03, 2021 10:47 amI am creating a backup using Image File Utilities ( viewtopic.php?f=29&t=247568 ) and was wondering if this will work properly also for a USB setup and how to restore it. Would I then restore the backup once to the SDCard and once to the SSD?
Each storage is only responsible for one of the two partitions after all.
If you have a Hybrid boot configuration (where the SD card is used to boot the USB device), you should maintain two backups.
1. Create a backup of the USB device when the USB device is booted and running.
2. Create a backup of the SD card when the SD card is booted and running.
If necessary, restore the backups to their associated devices.
Re: Running Raspbian from USB Devices : Made Easy
Can I use usb boot to copy the contents of a usb drive back to an SD card?
Re: Running Raspbian from USB Devices : Made Easy
Yes.
Place the SD card in a USB adapter and select it as the destination when you run usb-boot (leave the SD card slot empty). Upon completion, the Raspberry Pi should boot from the SD card inserted in the SD card slot (see Raspberry Pi EEPROM Manager if you need to change the boot order).
Re: Running Raspbian from USB Devices : Made Easy
I'm having a bit of frustration getting my PI 4 B booting on a SSD and I think it might be related to the fact that it's a 5 TB SSD.
I've downloaded usb-boot and run mbr2gpt on the drive and my setup looks as follows;
pi@raspberrypi:~/usb-boot $ sudo ./usb-boot
Aborted
pi@raspberrypi:~/usb-boot $
Thoughts anyone ?
Thanks,
Gw
I've downloaded usb-boot and run mbr2gpt on the drive and my setup looks as follows;
It sees the drive, sees the 256M partition.pi@raspberrypi:~/usb-boot $ sudo lsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODEL
UUID..................................NAME FSTYPE SIZE MOUNTPOINT LABEL MODEL
............................................ sda 4.6T ST5000LM000-2AN170
6284-658D.........................─sda1 vfat 256M /boot boot
..............................................mmcblk0 119.3G
6284-658D...........................├─mmcblk0p1 vfat 256M boot
3a324232-335f-46............... ─mmcblk0p2 ext4 119G / rootfs
usb-boot asks it's 2 questions then dies;pi@raspberrypi:~/usb-boot $ sudo fdisk -l /dev/sda1
Disk /dev/sda1: 256 MiB, 268435456 bytes, 524288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
pi@raspberrypi:~/usb-boot $ sudo ./usb-boot
Aborted
pi@raspberrypi:~/usb-boot $
Thoughts anyone ?
Thanks,
Gw
Re: Running Raspbian from USB Devices : Made Easy
I'm assuming you are starting out with a new 5TB drive and wanting to move an SD card system to it using usb-boot.
You do not need to use mbr2gpt with usb-boot since usb-boot takes care of all partitioning and formatting of the target device.
Most likely usb-boot is reporting 'Aborted' because you are not selecting the target device:
"Use the arrow keys on your keyboard to navigate to the desired device and press the spacebar to select it. Then use the tab key to navigate to the 'Ok' or 'Cancel' button and press the return key."
Re: Running Raspbian from USB Devices : Made Easy
Ron, Thanks for pointing out the selection. I am a bit color blind and just didn't notice the 'check' part of the box.RonR wrote: ↑Sat Jun 26, 2021 2:52 amMost likely usb-boot is reporting 'Aborted' because you are not selecting the target device:
"Use the arrow keys on your keyboard to navigate to the desired device and press the spacebar to select it. Then use the tab key to navigate to the 'Ok' or 'Cancel' button and press the return key."
Now that I'm running this way, what happens when I do system updates.
I'm guessing it will update the the partition on the 5Tb HD leaving the SD alone.
Can/should I then use the SD copier to copy the HD to the SD ? (Should both boot partitions be kept in sync ?)
Can you suggest a different way of backing up the boot partitions ?
I'm thinking Encryption, with the Key on the Card, and thus requiring the Card be physically in the device to make use of it.
Once it's up pull the card and let it run that way. (My Raspberry PI4 is running as a Plex Media Server)
I'm thinking Something like this https://www.golinuxcloud.com/mount-luks ... ion-linux/ for encryption.
Your thoughts on pitfalls appreciated.
Thanks
Gw
Re: Running Raspbian from USB Devices : Made Easy
GeeWhiz wrote: ↑Wed Jul 14, 2021 3:53 amNow that I'm running this way, what happens when I do system updates.
I'm guessing it will update the the partition on the 5Tb HD leaving the SD alone.
Can/should I then use the SD copier to copy the HD to the SD ? (Should both boot partitions be kept in sync ?)
Can you suggest a different way of backing up the boot partitions ?
Once you've used usb-boot to copy the SD card to the HD (presumably answering 'No' to the 'Use SD card to boot the USB device?' question since you have a Raspberry Pi 4B), you would normally set the EEPROM boot order for USB_MSD first (Raspberry Pi EEPROM Manager makes this a simple task). At this point, you're done with the SD card and it can be removed. Everything (including system updates) will occur on the HD.
image-backup is a good candidate for making backups, but I wouldn't consider an SD card for the destination of backups.
GeeWhiz wrote: ↑Wed Jul 14, 2021 3:53 amI'm thinking Encryption, with the Key on the Card, and thus requiring the Card be physically in the device to make use of it.
Once it's up pull the card and let it run that way. (My Raspberry PI4 is running as a Plex Media Server)
I'm thinking Something like this https://www.golinuxcloud.com/mount-luks ... ion-linux/ for encryption.
Encryption is unrelated to usb-boot. You should start a new topic for discussion of encryption considerations.
Re: Running Raspbian from USB Devices : Made Easy
RonR wrote: ↑Wed Jul 14, 2021 4:19 amFirst, thanks for the references to 2 great utilities. [rpi-eeprom-mgr, image-backup]
I think I've set it up to boot off the SD if it's there, and then transfers/moves the OS execution to the HD (Hybrid?).
I choose this because of my wish to have a SD boot which mounts and decrypts the media partition and then can be removed.
I will start a new Encryption thread for this. Thanks again for your help.
Re: Running Raspbian from USB Devices : Made Easy
With the Raspberry Pi 4B, native (EEPROM) booting is highly preferable to Hybrid booting. With Hybrid booting, the SD card's BOOT partition is mounted on /boot and will be updated by system updates. The BOOT partition on the HD will not be used and will not be updated. This means that booting the HD in the absence of an SD card will sooner or later fail because of an out-of-date BOOT partition.
image-backup will create a backup containing the ROOT partition from the HD and the BOOT partition from the SD card in a Hybrid configuration. Restoring this backup to any device (SD card or USB) will result in a properly working device. With a Hybrid system, however, restoration of the BOOT partition (only) of the backup image to the SD card requires a little work. Before the Raspberry Pi 4, I always booted the SD card periodically (using sdc-boot), updated and made a separate backup of it before switching back to booting the USB device.
Again, think carefully about using Hybrid booting on a Raspberry Pi 4B. EEPROM booting has much more to offer and eliminates a number of headaches that Hybrid booting can present.
Re: Running Raspbian from USB Devices : Made Easy
I will take your advice and move to booting off the HD.
I changed the boot order via rpi-eeprom-mgr pulled the SD card and let it try to boot. BUT alas it did not.
Put the SD card back and it was back to normal though not optimal.
The Device looks right by my eye. Am I missing something ?
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 532480 250085375 249552896 119G 83 Linux
#internal drive
Disk /dev/sda: 4.6 TiB, 5000981078016 bytes, 9767541168 sectors
Device Start End Sectors Size Type
/dev/sda1 2048 526335 524288 256M Microsoft basic data
/dev/sda2 526336 9767541134 9767014799 4.6T Linux filesystem
You've been most helpful, I really appreciate your time.
Thanks again.
Re: Running Raspbian from USB Devices : Made Easy
Is the boot order?:
USB_MSD
SD Card
If so, I would do the following:
1. Edit /boot/cmdline.txt and set:
root=/dev/mmcblk0p2
2. Shutdown and unplug the HD.
3. Power up the Raspberry Pi and wait for the SD card to boot (it will take 20 seconds just to start the process).
4. Plug the HD back in.
5. Run usb-boot and answer 'No' to 'Use SD card to boot the USB device?'.
6. Answer 'No' to 'Replicate BOOT/ROOT contents...?'.
7. Shutdown and remove the SD card.
8. Power up and the HD should boot.
If the HD doesn't boot, watch the bootloader diagnostic screen for clues.
Re: Running Raspbian from USB Devices : Made Easy
2. Shutdown and unplug the HD.
3. Power up the Raspberry Pi and wait for the SD card to boot (it will take 20 seconds just to start the process).
I think I changed what you suggested as shown below.
console=serial0,115200 console=tty1 root=PARTUUID=30562f70-d11b-4845-9d64-7c9fda27746e rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
to
console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
However it did not boot, I tried root=PARTUUID=f2a758a3-02 which was from an earlier backup.
This matches up to the 2nd partition on the SD disk and it did boot.
I'm not sure exactly why one format worked over the other.
After following the rest of your directions, I am successfully booting of the HD.
Again thank you for your patience and help
Re: Running Raspbian from USB Devices : Made Easy
GeeWhiz wrote: ↑Sun Jul 18, 2021 12:33 amI think I changed what you suggested as shown below.
console=serial0,115200 console=tty1 root=PARTUUID=30562f70-d11b-4845-9d64-7c9fda27746e rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
to
console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
However it did not boot, I tried root=PARTUUID=f2a758a3-02 which was from an earlier backup.
This matches up to the 2nd partition on the SD disk and it did boot.
I'm not sure exactly why one format worked over the other.
After following the rest of your directions, I am successfully booting of the HD.
I'm not sure why 'root=/dev/mmcblk0p2' (which is the 2nd partition on the SD card) didn't work for you. I just tried it on an SD card here with fstab left at PARTUUID=hhhhhhhh-02 and it booted just fine. I didn't know your PARTUUID value, so I suggested 'root=/dev/mmcblk0p2' which should have been guaranteed to work. Life is full of mysteries. :o
The good news is both the SD card and the HD are booting properly now and we have a happy ending to the story. Have fun!
Re: Running Raspbian from USB Devices : Made Easy
I have been using USB-Boot for a few months now but yesterday my Pi stopped working. Reboot fails with I/O errors on sda2.
Am I correct in thinking that the filesystem on the SSD is corrupt or maybe even the SDD damaged?
I would like to repair it (even if only temporarily) so I can boot to my SDD and backup the data. All I need is to get the system up and running again from the SDD so I can access my docker containers and backup everything.
Does anybody know how I could achieve this?
Am I correct in thinking that the filesystem on the SSD is corrupt or maybe even the SDD damaged?
I would like to repair it (even if only temporarily) so I can boot to my SDD and backup the data. All I need is to get the system up and running again from the SDD so I can access my docker containers and backup everything.
Does anybody know how I could achieve this?
Re: Running Raspbian from USB Devices : Made Easy
When I went this route, I started with booting of the SD card, then used usb-boot to create the partitions on the SSD and copy the OS.
This left me with a SD card for backup, and then boot of the SSD. (i've made reverse backups from the SSD back to the SD)
My suggestion would be to boot off your SD (or build a new one). If the SSD is accessible, you can copy your files off, then refresh the OS on the SSD. If it's not accessible, I'd suggest re-seating it. If you have other Linux boxes, you could try reading it from there.
Best of luck.
This left me with a SD card for backup, and then boot of the SSD. (i've made reverse backups from the SSD back to the SD)
My suggestion would be to boot off your SD (or build a new one). If the SSD is accessible, you can copy your files off, then refresh the OS on the SSD. If it's not accessible, I'd suggest re-seating it. If you have other Linux boxes, you could try reading it from there.
Best of luck.
Re: Running Raspbian from USB Devices : Made Easy
I have my Raspberry Pi 4B booting from a Sandisk Ultra Fit 32GB flash drive. I am using this flash drive because it is very short so it can't be pulled loose like a regular flash drive. Is there any problem using a flash drive?
Re: Running Raspbian from USB Devices : Made Easy
No. I've been running from USB flash drives since I purchased my first Raspberry Pi almost 8 years ago.
Re: Running Raspbian from USB Devices : Made Easy
I moved my Raspbian from an SD card to a USB flash drive yesterday. It works fine except Raspian expanded the partition to use up all available space on the USB drive. If I were to replicate the SD card again, is there an option so it will not "auto expend"?
Re: Running Raspbian from USB Devices : Made Easy
There is no such option as there is no auto-expansion taking place. usb-boot simply partitions the destination USB device as a 256M BOOT partition and the rest as a ROOT partition. If you want something different, you will have to alter it manually after the fact.
Re: Running Raspbian from USB Devices : Made Easy
After I used usb-boot to replicate the system, I notice the cmdlist.txt and fstab on the sd card are not using mmcblk0p1/2 to point to boot partitions but PARTUUIDs are used instead. Does this mean I can image backup the SD card and restore it either to another SD card or USB and both will boot?RonR wrote: ↑Thu Jun 10, 2021 5:08 am
Yes.
Place the SD card in a USB adapter and select it as the destination when you run usb-boot (leave the SD card slot empty). Upon completion, the Raspberry Pi should boot from the SD card inserted in the SD card slot (see Raspberry Pi EEPROM Manager if you need to change the boot order).
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion