Welcome! Log In Create A New Profile

Advanced

Backup of the Debian USB stick

Posted by funtoy1001 
Backup of the Debian USB stick
January 12, 2011 10:37AM
I have Debian running fine on a USB stick. Currently, I have to remove the USB stick and use dd on my desktop when I want to do an image backup. Are there issues if I do dd on the DockStar itself? I know it is going to be slow but I can set it up so the image back up is done during "middle of the night".
Re: Backup of the Debian USB stick
January 12, 2011 02:35PM
Here's what I do:

Quote

# cd / && find . dev -mount | cpio -oc | gzip >/sheeva/res/root-`date +%F`.cgz

where, obviously, the /sheeva directory is mounted (not part of the root file system). This should produce a backup that provides everything you need should you need to restore your root file system, but it populates /dev with more devices than is actually needed, a minor but tolerable nit.
Re: Backup of the Debian USB stick
January 12, 2011 04:43PM
Thanks. I tried what you posted and it is pretty fast. Took about 20 minutes for my 3.6 GB USB stick.
Re: Backup of the Debian USB stick
June 09, 2011 11:43PM
Sorry to dig up an old thread. What is the proper way to restore the USB stick from the resulted file?
dpffan
Re: Backup of the Debian USB stick
June 10, 2011 06:35AM
The output is a date-stamp filename gzipped cpio archive, so the reverse is something along the line of http://boo.booboodo.com:57239/phpBB3/viewtopic.php?f=11&t=76. Modify the filename accordingly.
Re: Backup of the Debian USB stick
June 10, 2011 08:20AM
Thanks. I restored my USB stick on my Ubuntu desktop.



Edited 1 time(s). Last edit at 06/10/2011 10:42AM by funtoy1001.
Re: Backup of the Debian USB stick
June 10, 2011 03:30PM
I have a question about dd command: is it safe to use dd command to backup the flash drive where the debain OS is running, i.e.,

dd if=/dev/sda1 of=/media/usb1/backup-disk.img

Thanks in advance.
dpffan
Re: Backup of the Debian USB stick
June 10, 2011 09:13PM
@davidnewton: I usually do dd from my linux desktop PC.
Re: Backup of the Debian USB stick
June 10, 2011 09:32PM
dpffan Wrote:
-------------------------------------------------------
> @davidnewton: I usually do dd from my linux
> desktop PC.

Thanks. That is also the way I usually use dd. With this way, I have to halt the dockstar with debain and put the flash drive to another linux machine and use dd to back it up. I am wondering if I could directly use dd on the dockstar/debian to back up the running flash drive.
rat
Re: Backup of the Debian USB stick
June 19, 2011 08:31PM
For people who want to back up their dockstar sticks but don't have another desktop to DD from... Clonezilla is pretty much going to be the only way worth trying. I tried several other imaging programs and all of them left off the swap partition. Make a bootable USB stick with the Clonezilla ISO and use that on another system to local source copy one stick to another.
Re: Backup of the Debian USB stick
June 21, 2011 03:38PM
Why do you need to back up the swap partition?
My favorite is still the Acronis true image (on PC). It will resize to a larger or small USB drive with no problem, when restore.
rat-netbook
Re: Backup of the Debian USB stick
June 22, 2011 04:12AM
twinclouds Wrote:
-------------------------------------------------------
> Why do you need to back up the swap partition?
> My favorite is still the Acronis true image (on
> PC). It will resize to a larger or small USB
> drive with no problem, when restore.


It's not the backing it up, it's making sure that a valid partition is made so that you don't end up without swap at all when using a new stick on the Dockstar. Rather than adding additional steps to the process of replacing a stick, just get it all done right the first time.

Clonezilla was the ONLY method that resulted in a swap partition being created. The others didn't even bother creating the partition at all.
Re: Backup of the Debian USB stick
June 23, 2011 08:00AM
rat-netbook Wrote:

> Clonezilla was the ONLY method that resulted in a
> swap partition being created. The others didn't
> even bother creating the partition at all.


Clonezilla is a great tool. I have used it to produce bootable restores (with correct swap partitions) to various boot drives including my Dockstar boot hard disk, linux liveusbs, and a Mac OS X SSD. The only thing it fails to produce a bootable restore of is the boot SDHC card for my Sheevaplug.
Re: Backup of the Debian USB stick
June 02, 2014 05:08AM
Hello,
I was looking for a way to backup my dockstar USB stick and found this old thread.
However I've not understood if they are what I'm looking for which is a simple script to backup the full USB stick on an external HD from within the dockstar itself while it is running from that USB stick.

So for example would it be okay provided that I have root / on /dev/sdb1 to and external HD on /mnt/hd to do something like this:

dd if=/dev/sdb1 of=/mnt/hd/backup.img ?

Or should I use if=/dev/sdb to include the swap partition also? (I understand that USB sticks do not have MBR)

How can I then restore the backup on a different (larger for example) USB stick.

I would like to put that script in the crontab in order to run it once a week for example.

Thanks.
Re: Backup of the Debian USB stick
June 02, 2014 08:17AM
Lallo,

It's best to use rsync. Don't use dd. Somewhere in the forum we discussed this, and a cron job is schedulded daily to execute it.

Found it here:
http://forum.doozan.com/read.php?2,12950,13049#msg-13049

In the above thread, syong also showed how it could be done using other backup command.

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



Edited 2 time(s). Last edit at 06/02/2014 08:22AM by bodhi.
Re: Backup of the Debian USB stick
July 02, 2014 11:04PM
dpffan Wrote:
-------------------------------------------------------
> The output is a date-stamp filename gzipped cpio
> archive, so the reverse is something along the
> line of
> http://boo.booboodo.com:57239/phpBB3/viewtopic.php
> ?f=11&t=76. Modify the filename accordingly.
Can someone help me out on the command I need to unpack a cgtz file? The link provided few years back are dead.

ETA: Hope I did it right.

I ended up with
gzip -dc /mnt/.... file.cgz | cpio -idumv



Edited 1 time(s). Last edit at 07/03/2014 09:59AM by funtoy1001.
Re: Backup of the Debian USB stick
September 28, 2014 11:38PM
------



Edited 1 time(s). Last edit at 09/29/2014 10:43AM by funtoy1001.
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: