LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-11-2005, 02:03 AM   #1
Child of Wonder
Member
 
Registered: Jul 2004
Location: Sioux Falls, SD
Distribution: Debian, Ubuntu, Fedora, Red Hat
Posts: 69

Rep: Reputation: 16
Recovering data from LVM


I'm currently running a file server using Debian 3.1 with 2.6.11 kernel and have two 250GB drives using LVM to make a volume group.

Now that my server no longer hosts a large message board I'm planning on installing Debian on a PIII 1GHz system and it will run solely as a file server.

My question is, will the new install of Debian recognize the data on the two 250GB drives if I set them up in LVM? Or will the new install not recognize the data and it'll be lost?

If so, can someone point me to a good step by step guide for copying an install of Linux from one hard drive to another?
 
Old 11-11-2005, 09:26 PM   #2
nonzero
Member
 
Registered: Feb 2005
Distribution: Debian FC4 LFS Slackware
Posts: 174

Rep: Reputation: 31
IMHO you've got a couple of ways to peel this banana, but whatever you do if you've got data on either of those drives that you cherish, refrain from pressing the return key until you are sure that is what you want to do. I am unclear as to what you are trying to accomplish. Are you switching the drives to another box? If so why not just put them in the new machine (assuming it is the same architecture - INTEL/AMD, and in the order they came out of the old one, of course) check the BIOS, and boot. The worst that can happen is that the kernel will panic and freeze. At best you may be able to get to a login prompt and perform your upgrades from there.
i.e. insert the correct video and network modules (assuming they are different between the two machines).
http://www.debian.org/doc/FAQ/ch-uptodate.en.html
Don't know if the above will get you any closer. I've used the Debian netinst CD since it became a feature and can't speak to it's upgrade capabilities. Just finished 2 Fedora Core 3 to 4 upgrades on servers that are LVM and they went flawlessly (I know, I know, different thing, but it was nice that it worked!). All the stuff's there and my tape backups stayed on the shelf. I've got other ideas but they get progressively kludgy.

nz
 
Old 11-11-2005, 10:32 PM   #3
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
The netinst CD will recognise LVM partitions, just set them up
(you probably should use the same volume and logical names unless you rename them first) without formatting them.
 
Old 11-12-2005, 02:02 AM   #4
Child of Wonder
Member
 
Registered: Jul 2004
Location: Sioux Falls, SD
Distribution: Debian, Ubuntu, Fedora, Red Hat
Posts: 69

Original Poster
Rep: Reputation: 16
I'll explain better what I'm trying to do.

Currently, I'm running a Debian server with an Athlon 2000+ and VIA KT266 chipset and a 40GB drive with /, /boot, and swap on it. I have two 250GB drives added to a VG using LVM. They are not using RAID, only LVM.

I would like to install Debian on another system with a Pentium III 1GHz and Intel chipset and transfer the two 250GB drives to this system.

I'm wondering if the new Debian install on the P3 system will recognize the VG and mount it using LVM without losing my data.

From what I've found through research that I should be OK but being that there's 280GB of data at stake and I want to make sure.
 
Old 11-12-2005, 07:13 AM   #5
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
I assume you mean that you will install a new system on it's own drive(s),
and move the 2x250GB drives to it (using portions of the data on them).
You will then have 3 or 4 drives total?
If so, install your new system without the 2x250GB drives,
but before you move your old drives to the new system,
I suggest you rename your VGs and LVs
# vgrename
# lvrename
so that they do not conflict with the (default) names on your new system.

In future you would probably be better off choosing a more segmented partitioning scheme
to avoid this problem:
ie:
/boot
vg0: (system volume group)
- root
- usr
- var
- swap
.... etc
vg1: (data volume group)
- board
- website
... etc

This will mean a complete new install is possible while retaining data.
You will also be able to snapshot, resize and copy partitions at will.
(leave a few MB free for snapshots .... I suggest 32MB min)


As an example: here's an (over-complicated) example on 2x60GB RAID1:
# fdisk -l /dev/hd[ac]

Disk /dev/hda: 60.0 GB, 60022480896 bytes
16 heads, 63 sectors/track, 116301 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 125 62968+ 83 Linux
/dev/hda2 126 374 125496 82 Linux swap / Solaris
/dev/hda3 375 2313 977256 fd Linux raid autodetect
/dev/hda4 2314 116301 57449952 5 Extended
/dev/hda5 2314 6282 2000344+ 8e Linux LVM
/dev/hda6 6283 15971 4883224+ fd Linux raid autodetect
/dev/hda7 15972 116301 50566288+ fd Linux raid autodetect

Disk /dev/hdc: 60.0 GB, 60022480896 bytes
16 heads, 63 sectors/track, 116301 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 125 62968+ 83 Linux
/dev/hdc2 126 374 125496 82 Linux swap / Solaris
/dev/hdc3 375 2313 977256 fd Linux raid autodetect
/dev/hdc4 2314 116301 57449952 5 Extended
/dev/hdc5 2314 6282 2000344+ 8e Linux LVM
/dev/hdc6 6283 15971 4883224+ fd Linux raid autodetect
/dev/hdc7 15972 116301 50566288+ fd Linux raid autodetect
# pvdisplay -C
PV VG Fmt Attr PSize PFree
/dev/hda5 vg3 lvm2 a- 1.91G 1.52G
/dev/hdc5 vg4 lvm2 a- 1.91G 1.52G
/dev/md0 vg0 lvm2 a- 1.86G 396.00M
/dev/md1 vg1 lvm2 a- 9.31G 0
/dev/md2 vg2 lvm2 a- 96.45G 264.00M
# vgdisplay -C
VG #PV #LV #SN Attr VSize VFree
vg0 1 8 0 wz--n 1.86G 396.00M
vg1 1 10 0 wz--n 9.31G 0
vg2 1 8 0 wz--n 96.45G 264.00M
vg3 1 10 0 wz--n 1.91G 1.52G
vg4 1 10 0 wz--n 1.91G 1.52G
# lvdisplay -C
LV VG Attr LSize Origin Snap% Move Copy%
home vg0 -wi-ao 128.00M
kernels vg0 -wi-ao 52.00M
modules vg0 -wi-ao 52.00M
root vg0 -wi-ao 256.00M
tmp vg0 -wi-ao 256.00M
usr vg0 -wi-ao 256.00M
var vg0 -wi-ao 256.00M
vbd-files vg0 -wi-ao 256.00M
BluetoothProxy vg1 -wi-ao 512.00M
Desktop vg1 -wi-a- 2.00G
Firewall vg1 -wi-ao 512.00M
FirewallVar vg1 -wi-ao 512.00M
MailServer vg1 -wi-ao 320.00M
WebServer vg1 -wi-ao 480.00M
buildroot vg1 -wi-a- 3.00G
gnap-test-01 vg1 -wi-ao 32.00M
rootfiles vg1 -wi-a- 1.00G
sargeXd vg1 -wi-a- 1.00G
Home vg2 -wi-ao 32.00G
Maildir vg2 -wi-ao 320.00M
WebRoot vg2 -wi-ao 5.00G
bigext3 vg2 -wi-a- 50.00G
buildroot-dev vg2 -wi-a- 3.00G
gentoo vg2 -wi-ao 5.00G
sarge-dev vg2 -wi-a- 384.00M
uclibc-dev vg2 -wi-a- 512.00M
swap16a0 vg3 -wi-a- 16.00M
swap16b0 vg3 -wi-a- 16.00M
swap16c0 vg3 -wi-a- 16.00M
swap32a0 vg3 -wi-ao 32.00M
swap32b0 vg3 -wi-ao 32.00M
swap32c0 vg3 -wi-ao 32.00M
swap64a0 vg3 -wi-a- 64.00M
swap64b0 vg3 -wi-ao 64.00M
swap64c0 vg3 -wi-a- 64.00M
swap64d0 vg3 -wi-a- 64.00M
swap16a1 vg4 -wi-a- 16.00M
swap16b1 vg4 -wi-a- 16.00M
swap16c1 vg4 -wi-a- 16.00M
swap32a1 vg4 -wi-ao 32.00M
swap32b1 vg4 -wi-ao 32.00M
swap32c1 vg4 -wi-ao 32.00M
swap64a1 vg4 -wi-a- 64.00M
swap64b1 vg4 -wi-ao 64.00M
swap64c1 vg4 -wi-a- 64.00M
swap64d1 vg4 -wi-a- 64.00M
 
Old 11-12-2005, 07:29 AM   #6
Child of Wonder
Member
 
Registered: Jul 2004
Location: Sioux Falls, SD
Distribution: Debian, Ubuntu, Fedora, Red Hat
Posts: 69

Original Poster
Rep: Reputation: 16
Thanks for the reply. I've got an extra 80GB drive laying around somewhere so I think I'm going to just use that and my desktop PC to back up all the data on my file server and then set the two 250GB drives up in the P3 system using RAID 0. Considering I use this file server to stream TV shows I record to other systems in the house using RAID wouldn't be a bad idea.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering Data for the less fortunate dlublink Linux - Hardware 2 03-20-2005 04:20 PM
recovering data pirozzi Linux - General 5 11-30-2004 03:08 AM
recovering data... marsques Linux - General 18 09-01-2004 03:36 PM
Recovering data CatSC Linux - Newbie 3 01-01-2004 12:25 AM
recovering formatted data walterw Linux - Newbie 4 11-09-2003 07:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration