Longevity of flash drives as rootfs carrier

This forum is for all other ARMv5 devices

Longevity of flash drives as rootfs carrier

Postby Kamen » Fri Jan 11, 2013 2:17 am

I got a second Pogoplug (P21) and will be setting it up as a web server (the first one is doing samba and DLNA). I used an old 2.5" HDD for the first one but I'm wondering if I could use a USB flash drive for the second one. Obviously, with all the daemons running and writing to the drive, I'm wondering how long a flash drive that is not optimized for this purpose (like an SSD) will last? Which also brings the subject of backing up the rootfs - what's a good way of doing that? Can one simply mount the drive to a Linux machine and copy it all? Does it matter how (e.g., file-by-file or rolling up a tarball)? If it's that simple, could one use instead some Windows utilities for reading ext3 (and if yes - which)?

By the way, I happen to have an old PC, nothing too crazy in terms of hardware, but I have already tried several Linuses (Mint, Ubuntu, Fedora, Damn Small Linux) and none have worked. Only Fedora installed but as soon as I ran the updater, it crashed irrecoverably. Windows runs fine on that PC. It has an ASUS A7V8X motherboard with a Promise RAID, and Fedora had all the drivers (it could see the primary IDE - Windows, secondary IDE - ext4, and SATA RAID 1+0 disks), except it complained it couldn't load the X environment (the videocard is a Radeon AIW 7200). I think I'll try Arch next.

Kamen
Pogoplugs: POGO-B01 (Classic) and POGO-E02 (v2)
Kamen
 
Posts: 27
Joined: Mon Sep 17, 2012 5:53 pm

Re: Longevity of flash drives as rootfs carrier

Postby Geoff » Fri Jan 11, 2013 4:21 am

$this->bbcode_second_pass_quote('Kamen', 'b')acking up the rootfs - what's a good way of doing that?

If you have two pogoplugs, you could plug in and backup the rootfs of one (e.g., usb stick) to someplace on the other (e.g., HDD). I prefer to use rsync like this (as root):

$this->bbcode_second_pass_code('', 'rsync -aAHWXxi --inplace --partial --no-compress --super --numeric-ids --delete --exclude=/lost+found/ /media/from_here/ /to_somplace/')
Geoff
 
Posts: 231
Joined: Wed Mar 09, 2011 5:14 pm

Re: Longevity of flash drives as rootfs carrier

Postby Kamen » Fri Jan 11, 2013 4:50 pm

$this->bbcode_second_pass_quote('Geoff', '')$this->bbcode_second_pass_quote('Kamen', 'b')acking up the rootfs - what's a good way of doing that?

If you have two pogoplugs, you could plug in and backup the rootfs of one (e.g., usb stick) to someplace on the other (e.g., HDD). I prefer to use rsync like this (as root):

$this->bbcode_second_pass_code('', 'rsync -aAHWXxi --inplace --partial --no-compress --super --numeric-ids --delete --exclude=/lost+found/ /media/from_here/ /to_somplace/')

Thank you, so much, Geoff! That's exactly what I wanted - addressing the issue directly and supporting it with a specific code example for the backup operation. If I could only bother you for one more thing - what would be the command to restore, in case the data on the original source is lost - can I use the same thing? I remember restoring a bootable partition being tricky (mount points in fstab?) Also, shouldn't I need to specify the root as source (e.g., /*) to copy the whole thing (you seem to suggest a subdirectory, or am I reading it wrong)? Also, shouldn't I have to exclude some other folders, like the mount point for the destination?
Thanks, again!
Kamen
Pogoplugs: POGO-B01 (Classic) and POGO-E02 (v2)
Kamen
 
Posts: 27
Joined: Mon Sep 17, 2012 5:53 pm
Top

Re: Longevity of flash drives as rootfs carrier

Postby WarheadsSE » Fri Jan 11, 2013 5:18 pm

$this->bbcode_second_pass_code('', 'rsync -aAHWXxi --inplace --partial --no-compress --super --numeric-ids --delete --exclude=/lost+found/ /from_someplace/ /media/to_here/')
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Longevity of flash drives as rootfs carrier

Postby Geoff » Fri Jan 11, 2013 6:14 pm

One more thing: it's often worthwhile to use the "-c" flag of rsync, as in "rsync -aAcHWXxi ...", although that takes a lot longer.
$this->bbcode_second_pass_quote('Kamen', 'I') remember restoring a bootable partition being tricky (mount points in fstab?)

If you're restoring onto a newly-partitioned device, then I suppose you might be wise to format the partitions with the same UUIDs and labels as the defunct device had.
$this->bbcode_second_pass_quote('Kamen', 'A')lso, shouldn't I need to specify the root as source (e.g., /*) to copy the whole thing (you seem to suggest a subdirectory, or am I reading it wrong)? Also, shouldn't I have to exclude some other folders, like the mount point for the destination?

The trailing slashes are very important, especially on the "from" side (see the manual). Also, you should not copy from the root partition that you have currently booted from, i.e., "/", and ABSOLUTELY NEVER copy to "/" (a guaranteed disaster). If you stay away from doing that, then your question about the mount point is moot.
Geoff
 
Posts: 231
Joined: Wed Mar 09, 2011 5:14 pm
Top

Re: Longevity of flash drives as rootfs carrier

Postby Kamen » Fri Jan 11, 2013 9:24 pm

$this->bbcode_second_pass_quote('Geoff', 'T')he trailing slashes are very important, especially on the "from" side (see the manual). Also, you should not copy from the root partition that you have currently booted from, i.e., "/", and ABSOLUTELY NEVER copy to "/" (a guaranteed disaster). If you stay away from doing that, then your question about the mount point is moot.

Let me make sure I understand. I thought I could make a complete (full) backup of the entire file system from within the same device; just like you would on a Windows computer (using Windows Backup or a 3-rd party software). But it seems like you're suggesting to mount the disk that is to be copied (hence your "/media/from_here/" source and no exclusions, other than lost+found) onto another working device and perform and store the backup there. Nothing wrong with that, it just didn't come to me immediately (and, I think, WarheadsSE might have also interpreted it differently).
So, as long as I partition and format the replacement media the same way I did the original, this manner of copying the rootfs would give me a bootable disk? Actually, probably not as, for example, I create the swap partition after I have setup the system. This part could get tricky.
Doing this properly is rather important, given how updates have occasionally rendered a system inoperable.
Kamen
Pogoplugs: POGO-B01 (Classic) and POGO-E02 (v2)
Kamen
 
Posts: 27
Joined: Mon Sep 17, 2012 5:53 pm
Top

Re: Longevity of flash drives as rootfs carrier

Postby Geoff » Sat Jan 12, 2013 12:57 am

$this->bbcode_second_pass_quote('Kamen', 'B')ut it seems like you're suggesting to mount the disk that is to be copied ... and, I think, WarheadsSE might have also interpreted it differently.

That's correct ... and WarheadsSE's response is consistent with this too.
$this->bbcode_second_pass_quote('Kamen', 'S')o, as long as I partition and format the replacement media the same way I did the original, this manner of copying the rootfs would give me a bootable disk? Actually, probably not as, for example, I create the swap partition after I have setup the system. This part could get tricky.

Yes, it should be bootable, same as the original. You can specify the UUID and/or label of a swap partition too, when you "mkswap" it, not particularly tricky. Of course, for the sake of longevity, you wouldn't want to put a swap partition on a USB flash drive anyway.
Geoff
 
Posts: 231
Joined: Wed Mar 09, 2011 5:14 pm
Top

Re: Longevity of flash drives as rootfs carrier

Postby permitivity » Mon Apr 29, 2013 12:37 am

Hi,
I'm pretty new to this, and I'm having difficulty following the thread. I'm in the same situation as the OP - but I have two pogoplugs. I got one pogoplug setup with a webcam app the way I want it, with Arch Linux running off a flash drive. I'd like to duplicate this USB drive and use the duplicate on the other Pogoplug.

If I get a Linux on a LiveCD to run on a PC, can I plug in two flash drives (the FROM drive and the TO drive), then I run the rsync command? The instructions from others seem to indicate that the rsync command is to be run from another pogoplug...I'm not sure how to do that.

Is there a way to use Windows to do this as well?

Thanks.
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am


Return to Community Supported

Who is online

Users browsing this forum: No registered users and 6 guests

cron