You are not logged in.

#1 2009-06-03 04:30:44

admasnd
Member
Registered: 2009-05-28
Posts: 11

a good means of backing up packages and config files to switch to LVM

I want to convert my current linux partitions into LVM partions, but I want to backup first. Is there a way to change them to LVM without re-installing Arch? I'm guessing that there isn't, but depending on the answer I would want to change the way I back up the data. If I have to re-install Arch, I would like to know of I way to make an image of the system to make the re-install go smoothly, but if switching to LVM can be done without re-installing, I would just like a way to backup my programs and my configuration files. In the latter case, what specific files need to be backed up. I currently have a 500GB external harddrive so that would be the medium I would use to backup.

Offline

#2 2009-06-03 05:44:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: a good means of backing up packages and config files to switch to LVM

Reinstall.

How big is your system drive that you're wanting to convert? If it's less than 500gb, then just create an image of it on your 500gb drive so you can mount it as a loop device once you're back up and running, and take anything you need off it to your new system.

dd if=/dev/sda1 of=/mnt/500gb/sda1.dd
mount -o loop /mnt/500gb/sda1.dd /mnt/old-system

Offline

#3 2009-06-03 05:58:34

admasnd
Member
Registered: 2009-05-28
Posts: 11

Re: a good means of backing up packages and config files to switch to LVM

fukawi2 wrote:

Reinstall.

How big is your system drive that you're wanting to convert? If it's less than 500gb, then just create an image of it on your 500gb drive so you can mount it as a loop device once you're back up and running, and take anything you need off it to your new system.

dd if=/dev/sda1 of=/mnt/500gb/sda1.dd
mount -o loop /mnt/500gb/sda1.dd /mnt/old-system

My laptop's harddrive is 250gb but I just want to transfer my linux partitions because I will not be messing with my Windows partition. Is there I way to selectively transfer partitions with dd and how exactly does a loop device work?

Offline

#4 2009-06-03 11:19:29

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: a good means of backing up packages and config files to switch to LVM

This is possible. If fact, I did this a couple of times back when I used gentoo. I could try to explain the process to you, but a gentoo user has already created a nice script & instructions on how to restore the backup afterwards: http://blinkeye.ch/dokuwiki/doku.php/projects/mkstage4

The directories that this script includes/excludes are somewhat specific to gentoo. You should be able to adjust the script to work for Arch, it doesn't do anything too fancy.

Offline

#5 2009-06-03 12:33:45

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: a good means of backing up packages and config files to switch to LVM

With the chance of repeating myself (ad infinitum) ...
Boot from a live cd and make a tarball - that saves an enormous amount of space -
something similar to this ...
I am assuming - just as an example - that you have _two_ linux partitions - /dev/sda1 and /dev/sda2 as '/' and '/home' - your mileage may vary

# your arch partitions
mkdir -p /mnt/arch/home
mount /dev/sda1 /mnt/arch
mount /dev/sda2 /mnt/arch/home
# then your usb-drive
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
# make the tarball
cd /mnt/arch && tar cvf /mnt/usb/archsys.tar .

# the when you are all done, just untar - though you have to remember to
# install grub again

[edit]: alternatively - you may want to make a tarball of each partition
[edit2]: grrrr - forgot the last 'dot' in the tar command - sorry

Last edited by perbh (2009-06-03 18:44:32)

Offline

#6 2009-06-03 22:35:25

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: a good means of backing up packages and config files to switch to LVM

admasnd wrote:
fukawi2 wrote:
dd if=/dev/sda1 of=/mnt/500gb/sda1.dd

My laptop's harddrive is 250gb but I just want to transfer my linux partitions because I will not be messing with my Windows partition. Is there I way to selectively transfer partitions with dd and how exactly does a loop device work?

In the dd command above, that was jsut an example to do /dev/sda1 -- replace sda1 for your first linux partition, then lather, rinse and repeat for your other partitions smile

Loop is a kernel feature that allows you to treat a file on disk as a block device (like a hard drive) and mount the file just like you can with a normal hard drive. Once it is mounted, it looks and behaves just like any other mounted drive.

As a side note, you can do this with ISO images you download like this:

mount -o loop -t iso9660 /path/to/iso/image /mnt/iso

You can then browse that CD image as if you had burnt it to CD and then put the CD in your drive.

dd creates an image that you can use the same way.

Offline

#7 2009-06-03 22:43:07

admasnd
Member
Registered: 2009-05-28
Posts: 11

Re: a good means of backing up packages and config files to switch to LVM

Thanks guys for the advice. I think I will go with using a livecd to tar theo partitions and put them on the external drive.

Offline

Board footer

Powered by FluxBB