You are not logged in.

#1 2009-07-15 01:57:47

trobins
Member
Registered: 2009-04-05
Posts: 27

Can I "lift" my install and put on a clean drive?

Over the past few years, my system (specifically my sda)  has become cluttered and sda has been broken into more partitions than I need or want. When I installed Arch, it was more an experiment than anything else. I had 2 other distros on sda then. I used 2 partitions that were currently unused, even though they are not the size I'd prefer.

Is there a simple way I can "lift" my current install from sda7 (/) and sda9 (/home), wipe the drive and reinstall to sda? I'd really prefer not to have to install again from scratch and then apply all the changes I've made. I have an empty USB drive (sdc, 500 GB) and can clear my data drive over there so I could use sdb (320 GB) if necessary.

Thanks in advance for any suggestions or links to information. I searched here on "remaster" and "mklivecd" but the info I found was all old enough it may be suspect now.

Tim

Offline

#2 2009-07-15 02:12:14

Square
Member
Registered: 2008-06-11
Posts: 435

Re: Can I "lift" my install and put on a clean drive?

I would suggest backing up your home directory, and then backing up a list of installed packages. i.e.

pacman -Qq > list

Then, you can merge your backed up home directory with the new one, and just use pacman to install the list of packages. i.e.

pacman -S --needed < list

It might be a good idea to find a way to filter out [core] packages, considering it'll already be installed.
EDIT: Taken care of in the example above. Also, if you don't do an ftp install you'll want to Syu before installing the list.

Last edited by Square (2009-07-15 02:18:25)


 

Offline

#3 2009-07-15 02:44:21

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: Can I "lift" my install and put on a clean drive?

I have one Arch install that has migrated through six drives and two different computers.  All you do is boot up Parted Magic and copy partitions around.  Expand partitions to fit the extra space.  Adjust your grub/menu.lst, maybe tweak the fstab file.  Although last week I did a dd clone from one drive to another and the UUIDs somehow carried over.  Did not have to adjust a thing.

Reinstalling from a package list is not fun.  Don't forget about /etc/, and /opt/, /boot/ and maybe even /usr/share/.

Slinging partitions from one drive to another is really simple, and Arch only needs one or two files tweaked to adapt the new layout.  In your case, boot up Parted Magic, mirror sda7 and 9 to a spare drive (just in case*) and just delete the junk partitions.  If you want to use primary partitions, now would be the time to rename sda7 and sda9.  Expand the two remaining partitions.  If you are still using sda7 and 9, it should still boot up exactly the same.  Otherwise, edit grub and fstab.

* I've never had Parted Magic (or the gparted live cd before it) corrupt data, but if something went wrong, nothing would be left.  Usually I clone from old to new, essentially creating a backup as it goes.

Offline

#4 2009-07-15 21:45:57

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: Can I "lift" my install and put on a clean drive?

I'm forever doing:

# rsync -av --delete /mnt/source/ /mnt/target/

to clone my arch installations. Then you usually only need to tinker with /boot/grub/menu.lst and /etc/fstab to make sure you reference the correct sdx partitions or UUIDs. If you clone to a different machine, of course you may also have to use a different video driver for X, etc.

Tip: Use the fallback image if your cloned system fails to boot with a "can't access root filesystem" error. One into the system, you can then recreate the correct boot images using mkinitcpio.

Offline

#5 2009-07-15 22:24:49

trobins
Member
Registered: 2009-04-05
Posts: 27

Re: Can I "lift" my install and put on a clean drive?

Thanks, ninian. Looks simple enough. In my case, I'll need to pick up the install (from sda7 and sda9), copy them over to another physical drive, then, using another distro's live CD, repartition sda, and finally copy / and /home from where I stored them back to sda1 and sda5. Does that make sense?

In your example, are "/mnt/source/" and "/mnt/target/" intended as examples, or must I first mount each partition (sda7 and sda9) inside /mnt?

Thanks.

Tim

Offline

#6 2009-07-15 22:46:41

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: Can I "lift" my install and put on a clean drive?

trobins wrote:

I'll need to pick up the install (from sda7 and sda9), copy them over to another physical drive, then, using another distro's live CD, repartition sda, and finally copy / and /home from where I stored them back to sda1 and sda5. Does that make sense?

Yes indeed it does!

trobins wrote:

In your example, are "/mnt/source/" and "/mnt/target/" intended as examples, or must I first mount each partition (sda7 and sda9) inside /mnt?

Yes, they were just examples; just mount your source and target directories wherever convenient from within the system you've booted up from a live CD or flash drive, etc. So you might have something like:

# mkdir /mnt/sda7
# mkdir /mnt/sda9
# mount -t ext3 /dev/sda7 /mnt/sda7
# mount -t ext3 /dev/sda9 /mnt/sda9
# mkdir /mnt/sdc1
# mount -t ext3 /dev/sdc1 /mnt/sdc1
# mkdir /mnt/sdc1/rootdir
# mkdir /mnt/sdc1/homedir
# rsync -av --delete /mnt/sda7/ /mnt/sdc1/rootdir/
# rsync -av --delete /mnt/sda9/ /mnt/sdc1/homedir/
sort out sda partitions, reboot from live CD, create appropriate mountpoints, remount partitions, etc and finally ...
# rsync -av --delete /mnt/sdc1/rootdir/ /mnt/sda1/
# rsync -av --delete /mnt/sdc1/homedir/ /mnt/sda5/

Hope this makes sense.

Last edited by ninian (2009-07-15 22:47:50)

Offline

#7 2009-07-16 00:24:44

trobins
Member
Registered: 2009-04-05
Posts: 27

Re: Can I "lift" my install and put on a clean drive?

Wow! Thanks. That's practically a complete script. I've saved it and also printed it out for reference when I actually do the task.

I must say, this is one of the reasons I switched from (unnamed distro) to Arch. On this forum, one gets useful responses instead of, "go search for an answer, newb!" or, "if you can't figure this out, perhaps you should go back to Windows," like I once saw on another forum.

Thanks again.

Tim

Offline

#8 2009-07-16 07:54:52

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: Can I "lift" my install and put on a clean drive?

trobins wrote:

I must say, this is one of the reasons I switched from (unnamed distro) to Arch. On this forum, one gets useful responses instead of, "go search for an answer, newb!" or, "if you can't figure this out, perhaps you should go back to Windows," like I once saw on another forum.

Thanks again.

You are most welcome; the cycle of a little bit of help and then appreciation makes us all feel better! wink
Hope everything goes well with the transfer.

PS: Don't know if you are already acquainted with the rsync -av switch, but it's worth reading up on to check the details of why it's ideal for cloning systems. I also use Image for Linux (see http://www.terabyteunlimited.com/image-for-linux.htm) when I need to backup entire disks or partitions as single image files. Of course, Partimage is a good (free) solution too, but Image for Linux gives me more facilities which I'm happy to pay a bit for.

Last edited by ninian (2009-07-16 08:00:23)

Offline

Board footer

Powered by FluxBB