[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Migrating system to RAID-1/LVM

On Sat, Dec 02, 2006 at 10:32:55AM -0500, David Bruce wrote:
> As a result of reiserfs corruption, I'm moving my system to ext3 (or maybe 
> JFS - haven't decided for sure).  I previously had a RAID-1/LVM setup on hda 
> and hdc, and the corruption occurred in my /home but nothing was lost.
> I have put a new disk in hdb and moved everything there with ddrescue - the 
> system now boots off the new disk without using hda or hdc. Also, all the 
> reiserfs partitions on the new disk are OK by fsck.  The installation has 
> separate partitions for /, /boot, /var, /tmp, /usr, and /home.
> I want to redo and un-cruft the hda/hdc RAID1/LVM installation.  My thought is 
> to do a clean install onto the disks with the etch installer.
> My question is how to best get my data from the hdb install onto the new 
> hda/hdc RAID install.  /home should be easy (I think using tar... | cd 
> tar ...).  As far as the other partitions are concerned, can I just copy them 
> over with the 'tar' method ?  I am mostly worried about clobbering the 
> settings for RAID and LVM in the new system.
> If I don't do a straight copy of my partitions other than /home, how can I at 
> least get the same apt packages installed? Also, there are of course a lot of 
> settings in /etc that I would like to keep - is there a simple way to 
> bring /etc over without messing up the settings for raid and lvm?
> Any suggestions would be greatly appreciated - thanks!
> -- 

Its called having solid backups.  Personally (since I've only just
installed LVM on RAID1 and don't know any better) I wouldn't fiddle with
changing disks arround without backups.  Actually, I don't even sleep
without solid backups.  See below for my backup strategy.

I also only use JFS now.  Search the archives for both reiserfs and jfs
and you'll find a good discussion.

I've had to do such stuff before (e.g. when ext2 got corrupted, when
ext3 got corrupted, and when reiserfs got corrupted).  Do your install
and setup as you like, ignoring hdb (but please back it up first, for
your friend Justin Case).  Use the netinst.iso and get a minimal (no X,
no tasks at all, just the basics) system up.  Ensure that you have
aptitude.  Then install mc. Then set up a mount point for hdb, e.g.
/oldhome and put that in /etc/fstab.

Now you can use mc and carefully move stuff from the old /etc to the new
one.  Do not just blindly copy /oldhome/etc to /etc.  Take the time an
look first.  If you weren't running Etch before, remember that some
things in /etc/ may have changed or moved around or been depreciated.
Since you didn't __upgrade__ to get to Etch you wouldn't have got any
warning about this from dpkg.

Then use aptitude and your list of installed packages from your backups.
Install in small chunks in order of priority.  Don't manually install
something that you don't explicitly want (e.g.
libabc123xyz-example.deb), but let aptitude install dependancies.  Also,
I don't have aptitude automatically install suggests or recommends.  

After each major install chunk where there's any doubt about booting, I
reboot to make sure that I still can.

/home itself should be fairly easy.  Especially if the old and new
system have the same userid for each username.

Last but not least, keep a log of what you're doing so that you can back
out of any problems.

Good luck.



I have three 'levels' of backups:

1.	minimal information needed to reinstall from bare metal:
		plain-text copy of anything critical in /etc
		plain-text copy of dpkg --get-selections
		partition info from sfdisk -d for all drives
		df --si output
		a plain text summary of all the hardware on the box
		a copy of /boot/grub/menu.lst
		a tar.bz2 of the entire /etc directory.

	This all fits on a floppy (standard MS format) so that I can
	read it on practically any computer on the planet if need be.
	Now that I've got USB this goes on a USB stick for the same
	reason.  The USB also contains the hd-media and netinst.iso
	installation set.

2.	"essential backup".  Stuff we always need access to even in the
	event of a disaster.  In our case, medial correspondance,
	emails, etc.

	This also fits in a directory on the floppy/USB.  There's a
	/home/essential_backup directory with directories for each user.
	Each user can put symlinks to important files here.  This is
	tarred up to follow symlinks so the actual files are backed up.
	I can access this by booting the USB stick and working from the

3.	The rest of the stuff that is ours (not Debian's): /home,
	/usr/local, /var/local (except /var/local/backup) in tar.bz2
 	This gets backed up to media-of-choice.  Used to be Zip disks,
	then CD-ROM, now this + USB.

	Since I'm now running raid1 on 80 GB drives, I'll soon also be
	using an 80 GB external laptop drive in a ruggedized carrier
	(addonics Jupiter ExDrive) that can withstand a 3 foot drop.
	Format it the same as the internal drives, add it to the raid1
	array, let it sync, remove it from the array and I'll have a
	fully bootable image of my entire system (which would include
	/var/local/backup where the above backups are).

	There will be two drive/carriers: one at home and one in the
	bank's vault.

		Thanks to Lennart Sorensen on the amd64 list for this
		suggestion (see thread off-site backup).

Reply to: