Backup of ArchLinux

This forum is for all other ARMv5 devices

Backup of ArchLinux

Postby megazal » Wed Apr 03, 2013 6:14 pm

I installed ArchLinux on pendrive. Because I'm not sure about quality of this pendrive and I also want to make some tests with a system (I'm still learning how to use it) I want to make a backup. Therefore I have 3 questions for experts.
1) Is it any simple way to make copy of my current system on other pendrive? I don't want to make an image of the disk (I've already made it). I want to make another pendrive that can boot my pogoplug with ArchLinux.
2) When I want to make any changes in Linux (e.g. pacman -Syu) all changes will be saved only on pendrive with system, am I right? I suppose that changes in internal memory of pogoplug were made only during first installation of ArchLinux which replaced original pogoplug system.
3) What will happen when I run pogoplug without pendrive with ArchLinux plugged into the device? Is it dangerous?
megazal
 
Posts: 9
Joined: Sun Mar 24, 2013 5:02 pm

Re: Backup of ArchLinux

Postby Geoff » Wed Apr 03, 2013 6:41 pm

$this->bbcode_second_pass_quote('megazal', '
')1) Is it any simple way to make copy of my current system on other pendrive? I don't want to make an image of the disk (I've already made it). I want to make another pendrive that can boot my pogoplug with ArchLinux.

Here's a thread that discusses it. It's best to copy between flash drives on another linux machine, not to or from a root filesystem that's in use.

$this->bbcode_second_pass_quote('megazal', '
')2) When I want to make any changes in Linux (e.g. pacman -Syu) all changes will be saved only on pendrive with system, am I right? I suppose that changes in internal memory of pogoplug were made only during first installation of ArchLinux which replaced original pogoplug system.

Right. The kernel in internal NAND memory doesn't get updated.

$this->bbcode_second_pass_quote('megazal', '
')3) What will happen when I run pogoplug without pendrive with ArchLinux plugged into the device? Is it dangerous?

The green light will flash forever, waiting for you to plug it in. It will not boot up until you do so.
Geoff
 
Posts: 231
Joined: Wed Mar 09, 2011 5:14 pm
Top

Re: Backup of ArchLinux

Postby megazal » Thu Apr 04, 2013 9:57 am

Ok, I have read linked thread. Now my idea is to run my laptop with ubuntu then plug pendrive with my ArchLinux to usb1 and empty pendrive to usb2 and use following command:

rsync -aAcHWXxi --inplace --partial --no-compress --super --numeric-ids --delete --exclude=/lost+found/ /media/usb1/ /media/usb2/

I understand that above mentioned command will copy all files from my current ArchLinux to empty pendrive except lost+found directory (why?). But how to make this new pendrive bootable? From linked thread I understood that I should:
1. format it with the same file system like original ArchLinux pendrive
2. name it like original ArchLinux pendrive
3. specify the same UUID like original ArchLinux pendrive
4. use rsync command
Am I right? Will be this new pendrive bootable after these 4 steps or should I make something more?
megazal
 
Posts: 9
Joined: Sun Mar 24, 2013 5:02 pm

Re: Backup of ArchLinux

Postby grayman4hire » Thu Apr 04, 2013 4:24 pm

Here are my notes on it - http://blog.qnology.com/2013/03/tutoria ... linux.html

Credit/Reference - viewtopic.php?f=18&t=5004

Offline Backup (Recommended) - These two methods, Disk Image and Tarball, requires unplugging the usb drive you want to backup and plugging it into another linux computer or VM, another pogoplug running alarm, or same pogoplug running alarm using a different usb flash drive.

1) Disk Image

#assumes /dev/sdb is the flash drive you want to backup
dd if=/dev/sdb of=/savetopath/pogoplug.e02.rootfs.backup.img bs=4M
#restore, swap if (in) and of (out)
dd if=/savetopath/pogoplug.e02.rootfs.backup.img of=/dev/sdb

2) Tarball

#assume the flash drive you want to backup is /dev/sdb1
mkdir /tmp/usb
mount /dev/sdb1 /tmp/usb

cd /tmp/usb
tar -cvzf /whereyouwantyourbackuptobe/pogoplug.e02.rootfs.backup.tar.gz ./

#restore
cd /tmp/usb
tar -xzvf /whereyouwantyourbackuptobe/pogoplug.e02.rootfs.backup.tar.gz

Online Backup using rsync
http://mouhassan.wordpress.com/2012/06/ ... -pogoplug/
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: Backup of ArchLinux

Postby Geoff » Thu Apr 04, 2013 4:26 pm

The rsync flags I had suggested in that thread were tailored to the case of backing up a USB flash drive to someplace on a HDD. The lost+found directory is supposed to exist only in the root directory of a filesystem. You're not supposed to create, delete or modify it yourself. Simple solution: just ignore it. I suggested the "-W" (whole-file) flag to speed up backup to a HDD; you wouldn't want to use it when backing up to or restoring to a flash drive, because it increases the amount of writing (wear) on the device. The "-c" flag compares source and destination files byte-for-byte, rather than just date+size, so of course it takes much longer to complete a backup, minutes rather than seconds. You should do that sometimes, but you can usually get away without. You might as well also unmount and run "fsck -fyC0" on both drives while you have the opportunity; run fsck again if it reports any errors. The pogoplug should see no difference between the two flash drives, so either one should boot up as well as the other, although some brands may work better than others.
Geoff
 
Posts: 231
Joined: Wed Mar 09, 2011 5:14 pm

Re: Backup of ArchLinux

Postby megazal » Thu Apr 04, 2013 8:10 pm

I made a copy of my ArchLinux pendrive but unfortunately it doesn't boot :-( Below what I made in steps:

1. I formated empty pendrive with ext4 file system and without any name.
2. I checked and noted UUIDs of my ArchLinux pendrive and empty pendrive with blkid command (here I will call them ArchLinuxUUID, EmptyPendriveUUID).
3. I copied ArchLinux to empty pendrive with command:
rsync -aAHXxi --inplace --partial --no-compress --super --numeric-ids --delete --exclude=/lost+found/ /media/ArchLinuxUUID/ /media/EmptyPendriveUUID/
4. I changed UUID of (previously) empty pendrive with command:
tune2fs /dev/sdd1 -U ArchLinuxUUID

As I wrote in the beginning new pendrive doesn't boot. The original one boots without any problem. Pendrives don't have the same size (original 2GB, new 4GB) but I think that even both are 2GB it doesn't mean they are identical. What more should I do to make new pendrive bootable?

EDIT
******
I've found the solution of my problem :-) Maybe someone will have similar problems in a future so below I will try to describe what I've done.
I have found in ubuntu quite big tool for drives managing (i don't know original name of this tool in English because I used this system in other language). From this tool I found that original ArchLinux pendrive has files type ext3 (not ext4) and partition type Linux (0x83). With simply format tool in ubuntu I had only choose ext2 or ext4 but partition type after format was Windows 95 FAT32 (0x0b). When I started to format my pendrive with this 'big' drives tool I was able to choose ext3 but partition type was still 0x0b. There is an option to change it but in my ubuntu it gives errors (too long waiting time in bus or someting like this). Therefore I removed the only one partition from my pendrive (still with using the same tool) and create new partition with ext3. After this operation partition type was Linux (0x83). Then I made steps 2-4 and now my pogo boots with brand new pendrive :-)
megazal
 
Posts: 9
Joined: Sun Mar 24, 2013 5:02 pm


Return to Community Supported

Who is online

Users browsing this forum: No registered users and 9 guests