Raspberry PI 1 run from USB Drive

i bought a Raspberry PI 1 back in 2013 or so and used it successfully as a add-on to my Home automation efforts.
used a external harddisk as its main drive instead of the SD card (as they do tend to fail rather quickly)
this works for multiple years, till the harddisk failed.

since then it was collecting dust in our Server room.

now (7 years later) i decided to try to get it back to life.

surprisingly, that worked pretty much flawless.

the SDCard was (of course) dead, so i downloaded a new image from Raspberrypi.com for headless operation.
made a quick DD to a new SD card, poked in and poof, it instantly worked.

i had some issues as i did not have enough power and some trouble getting a keyboard to work, but thats all logistics issues.

so in order to make it run for longer than a week, (SDCards will not have a very long lifespan, if the computer is doing more then being idle)
i grabbed a Flashdrive with 32Gb (used for Windows installs which i not plan to do anytime soon anyway)

poke it in, and up to the task to getting it boot from it.

since it’s a RPI Version 1, it can not directly boot from USB, so the SD card will have to stay in place,
but it will be read-only, which will extend its lifespan dramatically.

the Job is simply to make it work from the SD-Card, and then move everything to the USB stick, and set the sdcard to read-only.

here are the simple steps to do this

  • run apt update
  • run apt upgrade
  • reboot
  • Install rpi-clone
    git clone https://github.com/billw2/rpi-clone.git
    cp rpi-clone rpi-clone-setup /usr/local/sbin
    rpi-clone-setup -t $(hostname -s)
    sudo rpi-clone -s
  • rpi-clone sda (sda or whatever your drive is)
    (this can take a VERY LONG TIME!)

while the cloning is running, log in one more time

  • find and note the UUID of the USB Partitions
    lsblk -o name,mountpoint,size,partuuid /dev/sda
  • edit cmdline.txt (/boot/firmware/cmdline.txt & /mnt/clone/boot/firmware/cmdline.txt)
    console=serial0,115200 console=tty1 root=PARTUUID=3b4344a4-07 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait rootdelay=5
    

    replace the PARTUUID with the one you just wrote down for the second partition

  • create a dummy folder for the sdcard mountpoint
    mkdir /sdcard
  • edit fstab (/etc/fstab & /mnt/clone/etc/fstab)
    change the original line mounting / to
    PARTUUID=c0bc77fc-02  /sdcard ext4 ro,nosuid,nodev,nofail,x-gvfs-show 0 0
    and put in the USB device as the new root
    PARTUUID=c7c144ae-02  / ext4 defaults,noatime  0       1
    make sure the UUID’s are matching

that’s it, after reboot the pi will use the USB Stick as its main disk on / while the sdcard is still avaiable read only under /sdcard

after verifying that everything is working, edit /etc/fstab one more time and make sure the /sdcard is mounted as read-only!

To top