User avatar
InsecureSpike
Posts: 23
Joined: Thu Feb 07, 2013 5:37 pm

Re: HOWTO: Move the filesystem to a USB stick

Thu Feb 13, 2014 12:47 pm

great work @paulv, thank you lots for this great guide!
and thanks to the other contributors too!
all working great with retropie

thanks again

User avatar
Elliott B
Posts: 96
Joined: Thu Jan 09, 2014 11:58 pm

Re: HOWTO: Move the filesystem to a USB stick

Mon Feb 17, 2014 8:12 am

I followed these instructions, except used MBR for my USB drive instead of GPT, so I never installed gdisk. I got the UUID using blkid, and wrote cmdline.txt like root=PARTUUID=xxxxxxxxx. It won't boot. I'm using Volumio.

User avatar
Elliott B
Posts: 96
Joined: Thu Jan 09, 2014 11:58 pm

Re: HOWTO: Move the filesystem to a USB stick

Mon Feb 17, 2014 6:54 pm

Thanks for the writeup. I followed this guide, and it's working, except one thing: Any change I make to /etc/fstab causes the system to reboot again immediately after the next reboot, after which fstab is reverted back to its original configuration. However, the root partition is being correctly mounted from the USB drive.

bpfh
Posts: 2
Joined: Tue Mar 11, 2014 6:58 am

Re: HOWTO: Move the filesystem to a USB stick

Tue Mar 11, 2014 7:05 am

The problem is as you mentionned, Flash is very fast for reading, and reading does not impact the card. They are reasonably fast for writing, but they do have a limited number of read-write cycles before failure - between 10000 and 100000 writes for some cheaper flash memory... This is not good, especially if you have logging thrashing the flash memory cells! You will have similar milage between a flash card and a key... If you really need to write a massive amount of data for a mission critical application (logfiles and traces for example), I would recommend that you boot from a hard drive (even if it is a 1 or 1.8 inch drive connected to the usb port!)

In my opinion, to keep flash wear level to a minimum, you would have to start the system read-only, then mount user writable partitions for your applications and use those, and make sure you keep commiting to flash only what is really needed.

After a quick search I came up with this: https://sites.google.com/site/linuxpendrive/rorootfs that may give you some help.

Cheers,
Daniel

User avatar
nerd7473
Posts: 42
Joined: Sat Jul 20, 2013 11:06 pm

Re: HOWTO: Move the filesystem to a USB stick

Tue Mar 11, 2014 4:02 pm

Is this for saving to the hard drive and booting from the SD? That is what I would like to do, I could have more memory and be able to use the SD only for booting.
nerd7473

PhilReitz
Posts: 3
Joined: Sat Mar 22, 2014 9:26 pm

Re: HOWTO: Move the filesystem to a USB stick

Sat Mar 22, 2014 9:44 pm

I have followed the instructions carefully, but neither the SD card nor USB flash drive (Verbatim Store-n-Go, 16gb) would boot. When I restore cmdline.txt to original, the SD card boots fine and the USB drive appears fine also. I do notice, however, that when the USB dive is plugged into my Win7 laptop, the file system shows as EXT3, not EXT4 as in the fstab config file. Could this be a problem?

I have tried with various SD cards and USB flash drives and instructions from other websites, but all with same non-results. Any clues or things to look at such as log files, config files, etc.?

User avatar
Elliott B
Posts: 96
Joined: Thu Jan 09, 2014 11:58 pm

Re: HOWTO: Move the filesystem to a USB stick

Sun Mar 23, 2014 12:33 am

Your fstab should match the drive's format. Try formatting it as ext4, or if you prefer ext3, then write that in the fstab.

PhilReitz
Posts: 3
Joined: Sat Mar 22, 2014 9:26 pm

Re: HOWTO: Move the filesystem to a USB stick

Sun Mar 23, 2014 1:48 am

The USB drive only shows up as EXT3 on windows; in Rasbian it's consistently EXT4. So I'm guessing the windows' mislabeling is just an artifact of Microsoft's diffidence toward Linux. :roll:

So I'm looking for some handles to start troubleshooting. Is the problem with the SD card or USB? Both appear fine when the cmdline.txt points to the root=/dev/mmcblk0p2, boot on that, then I manually mount /dev/sda1 on /mnt. But when cmdline.txt points to the root=/dev/sda1, not a single flash shows up on the status lights.

So a basic question is, what exactly happens internally once cmdline.txt is read? And is there a record of this in a log file somewhere? :?:

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

Re: HOWTO: Move the filesystem to a USB stick

Sun Mar 23, 2014 9:09 am

Try setting rootdelay to a greater value, e.g.
rootdelay=10
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

ROBCHI
Posts: 1
Joined: Sun Mar 23, 2014 5:05 pm

Re: HOWTO: Move the filesystem to a USB stick

Sun Mar 23, 2014 5:07 pm

Thank you for this 'HowTo'! worked perfectly for me. Much appreciated!

359
Posts: 16
Joined: Thu May 29, 2014 7:55 pm

Re: HOWTO: Move the filesystem to a USB stick

Thu May 29, 2014 8:00 pm

Hi, also thanks for this how to, worked well. From a rookie, how would I now backup the USB before making big changes/experiments! With sd used win32 tool. Now with 64gig USB, this will give 64gig image? Too big. Cheers

Edit.. Rsync sorted this issue!

User avatar
InsecureSpike
Posts: 23
Joined: Thu Feb 07, 2013 5:37 pm

Re: HOWTO: Move the filesystem to a USB stick

Thu Jun 19, 2014 5:02 pm

guy's, how would i go about upgrading to a larger usb drive?
i went through and did the extended procedure too, or would doing this stop me from moving to a larger usb drive? because of the Partition unique GUID & Filesystem UUID?
as you can probably tell, i'm still very much a beginner, but any help would be great!
thanks

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: HOWTO: Move the filesystem to a USB stick

Fri Jun 20, 2014 7:43 am

InsecureSpike wrote:guy's, how would i go about upgrading to a larger usb drive?
i went through and did the extended procedure too, or would doing this stop me from moving to a larger usb drive? because of the Partition unique GUID & Filesystem UUID?
as you can probably tell, i'm still very much a beginner, but any help would be great!
thanks
you should have no issue
I have one RPi running on a 600GB 2" Drive [usb connected]
as long as you can format the drive it should be fine
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
InsecureSpike
Posts: 23
Joined: Thu Feb 07, 2013 5:37 pm

Re: HOWTO: Move the filesystem to a USB stick

Fri Jun 20, 2014 11:41 am

RaTTuS wrote:
InsecureSpike wrote:guy's, how would i go about upgrading to a larger usb drive?
i went through and did the extended procedure too, or would doing this stop me from moving to a larger usb drive? because of the Partition unique GUID & Filesystem UUID?
as you can probably tell, i'm still very much a beginner, but any help would be great!
thanks
you should have no issue
I have one RPi running on a 600GB 2" Drive [usb connected]
as long as you can format the drive it should be fine
oh thats great news, do you have any idea if theres a little "how to" guide any where?
i only as as i'm not too sure what i should google/search for
thanks

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: HOWTO: Move the filesystem to a USB stick

Thu Jun 26, 2014 1:00 pm

Hi paulv,

I tried your extended solution with Partition unique GUID. But in my case (I don't know why) this is changing everytime I reboot my RPi. So when I use it in cmdline.txt I can't boot next time.

Any Idea what is wrong with this in my case?

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

Re: HOWTO: Move the filesystem to a USB stick

Thu Jun 26, 2014 7:44 pm

Hi Miamia,

You mean that the Partition unique GUID is changing at every boot?
How about the Filesystem UUID, is that changing too?

Unfortunately, I have no input on what is causing this strange behavior.
I hope somebody else can chime in?

Good luck,
Paul

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: HOWTO: Move the filesystem to a USB stick

Fri Jun 27, 2014 8:23 am

paulv wrote: You mean that the Partition unique GUID is changing at every boot?
How about the Filesystem UUID, is that changing too?
Hi Paul,
Partition unique GUID - is changing at every boot.
Filesystem UUID - is persistent.
Partition GUID code - is persistent.

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

Re: HOWTO: Move the filesystem to a USB stick

Fri Jun 27, 2014 10:30 am

I have no idea on what is going on and how to solve that.
Anybody????

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: HOWTO: Move the filesystem to a USB stick

Fri Jun 27, 2014 12:09 pm

Note: I tried all my RPies. After reboot "Partition unique GUID" is changed again and again.

Anybody any idea?

User avatar
DougieLawson
Posts: 36526
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: HOWTO: Move the filesystem to a USB stick

Fri Jun 27, 2014 4:13 pm

Use the UUID returned by a blkid command.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: HOWTO: Move the filesystem to a USB stick

Fri Jun 27, 2014 5:22 pm

Good input, but you have to use
sudo blkid
otherwise it returns nothing.

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: HOWTO: Move the filesystem to a USB stick

Sun Jun 29, 2014 10:42 am

thanks, but what prefix for blkid shoudl I use in /boot/cmdline.txt? "root=PARTUUID="?

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: HOWTO: Move the filesystem to a USB stick

Sun Jun 29, 2014 10:48 am

miamia wrote:thanks, but what prefix for blkid shoudl I use in /boot/cmdline.txt? "root=PARTUUID="?
I found on internet this: root=/dev/disk/by-uuid/xxxxxxx. Maybe it helps.
EDITED: my RPi cannot boot with root=/dev/disk/by-uuid/xxxxxxx. With root=dev/sda1 everything works ok.

louwilkinson
Posts: 1
Joined: Fri Jul 11, 2014 2:03 pm

Re: HOWTO: Move the filesystem to a USB stick

Fri Jul 11, 2014 2:10 pm

Thanks.

This worked perfectly. (not the first time....i, apparently, lack a few reading skills...but upon CLOSE reading, it worked perfectly)

dms489
Posts: 1
Joined: Sat Jul 05, 2014 3:23 pm
Location: Marietta, GA, USA

Re: HOWTO: Move the filesystem to a USB stick

Fri Jul 11, 2014 11:29 pm

I'm a newbie trying to do the same thing, but when I first boot the SD card, the Pi automagically runs the file system expansion. How do you stop it so you can control the configuration as the author indicated?

Return to “Advanced users”