Welcome! Log In Create A New Profile

Advanced

How do you all backup a USB-stick operating system?

Posted by JoeyPogoPlugE02 
How do you all backup a USB-stick operating system?
May 19, 2015 07:18PM
Over here I've been taking say, an Arch-E02 stick and plug it into a Windows machine with another USB stick that's unallocated. Use the freeware Partition Wizard and copy. This works quickly, but you're fairly limited to one destination.

I've heard you all talk about making a TAR file out of an install, and think that sounds great - after all I could have a folder somewhere with several builds - meaning a lot more flexibility than that one single backup. A lot of solutions have crossed my mind, like a hard drive with a lot of 8-GB partitions and one last FAT32 partition with a text file stating what is in each partition, but that would likely run into problems as well.

Do any of you have a method for making a folder of TARs or RARs or Zips of pogOSs? Heh, PogOS's...

=========
-= Cloud 9 =-
Re: How do you all backup a USB-stick operating system?
May 19, 2015 09:36PM
I've used something like the following for years:

# cd / && find . dev -mount | cpio -oc | gzip >/Some-mounted-offline-backup-partition/root-`date +%F`.cgz

You'll need to repeat this for every active filesystem on the USB stick (perhaps /var, /home, etc.), but not the pseudo-file systems (proc, sys, run, etc.). The "dev" above is only needed on the root-fs as it requires some /dev entries be defined before it mounts the dev pseudo-fs.

I have done this for years on active machines and had any problems reincarnating a system from a backup. Of course, it isn't plug-and-play, you have to build a new USB drive from the .cgz backup files first using fdisk, mkfs, and "cpio -icdm". If you'd like more information, let me know.
letting you know
May 20, 2015 12:19AM
Sure if you'd like to expound, no pressure. I've used most of those commands and have nothing against learning the proper methods.

Truth be fully told, I'm not above foolproof methods either, like a way to insert stick into another Linux box and tar a drive image out of it.
I'm just doing what I can, day to day; you know how things can get lazy in the summer.

=========
-= Cloud 9 =-
Re: letting you know
May 20, 2015 04:05PM
Joey,

restamp showed how to copy a live rootfs. You can also make a simple back up process by taking it offline. Bring the stick to where you want to backup and mount it in this box.

# where to keep the backup tarball, for example /media/HDD/Backup
mkdir /media/HDD/Backup


# change dir to top directory of the USB rootfs (assuming it's mounted as /media/USB)
cd /media/USB


# create the tarball named Joey_rootfs_150520.tar.gz
tar -czf /media/HDD/Backup/Joey_rootfs_150520.tar.gz .

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 05/20/2015 04:06PM by bodhi.
makes all the difference
May 20, 2015 05:00PM
I can't tell you how good it feels to do command line stuff and have the knowledge of what's going on. Real paradigm shift.
I'll try this ASAP but not now, as measuring twice is working for me

=========
-= Cloud 9 =-
Re: letting you know
May 20, 2015 05:08PM
tar -czf /media/HDD/Backup/Joey_rootfs_150520.tar.gz .

The above is the gzip compession, fast but not compressed as much as bz2

to make it smaller, but the backup command will take longer:

tar -cjf /media/HDD/Backup/Joey_rootfs_150520.tar.bz2 .

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: