PDA

View Full Version : Mounting an LVM hard drive.


ivytoba
2009-01-20, 02:26 PM CST
Hello All,

I just

1) removed my 200 GB LVM formatted hard drive (with Fedora 7)
2) Installed a new 300 GB hard drive
3) Installed Fedora 10
4) Connected my "old" 200 GB LVM disc as a slave device.

How do I mount the 200 GB LVM so that I can transfer the data to my new 300 GB disc?

Apparently there is a conflict with the names. In both drives the LVM are called Volume00.

Can anybody help? I do not want to merge both drives into a larger virtual volume.

Thank you

ivytoba

********************
Here are some outputs. Notice that in both old and new discs I have a ~50GB NTFS partition with MS Windows.

# fdisk -l

Disk /dev/sda: 300.0 GB, 300090728448 bytes
240 heads, 63 sectors/track, 38764 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x000d2a90

Device Boot Start End Blocks Id System
/dev/sda1 27 6806 51247350 7 HPFS/NTFS
/dev/sda2 * 6807 6832 196560 83 Linux
/dev/sda3 6833 38764 241405920 8e Linux LVM

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
240 heads, 63 sectors/track, 26342 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x1a731a72

Device Boot Start End Blocks Id System
/dev/sdb1 * 15 6782 51166048+ 7 HPFS/NTFS
/dev/sdb2 1 14 105808+ 83 Linux
/dev/sdb3 6783 26342 147873600 8e Linux LVM

Partition table entries are not in disk order


# mount
/dev/dm-0 on / type ext3 (rw)
/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda2 on /boot type ext3 (rw)
/dev/sda1 on /media/windows type fuseblk (rw,allow_other,blksize=4096)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /home/nazashal/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=nazashal)

brunson
2009-01-20, 02:32 PM CST
Since it was formerly your primary drive, I'll assume it's VolGroup00 and LogVol00.

First you activate the volume group with 'vgchange -a y VolGroup00", this will make the logical volumes show up in /dev/mapper. You can them mount the volume with "mount /dev/mapper/VolGroup00-LogVol00 /path/to/mountpoint"

If it isn't named that way then use vgscan and lvscan to find them out.

ivytoba
2009-01-20, 02:41 PM CST
Hello Brunson,

Well, that's where the name conflict shows up. This is a copy-paste of the session.

$ su root
Password:

# vgchange -a y VolGroup00
2 logical volume(s) in volume group "VolGroup00" now active

# df -hk
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/dm-0 233518000 4966636 216689348 3% /
tmpfs 1037112 504 1036608 1% /dev/shm
/dev/sda2 190355 20711 159816 12% /boot
/dev/sda1 51247348 34167184 17080164 67% /media/windows

# mount /dev/mapper/VolGroup00-LogVol00 /scratch

# df -hk
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/dm-0 233518000 4966636 216689348 3% /
tmpfs 1037112 504 1036608 1% /dev/shm
/dev/sda2 190355 20711 159816 12% /boot
/dev/sda1 51247348 34167184 17080164 67% /media/windows
/dev/mapper/VolGroup00-LogVol00
233518000 4966636 216689348 3% /scratch

As you see, this just mounted a ~233 GB partition. That means that is is remounting the already active partition in the new 300 GB drive. I want to mount the old hard drive so that I can extract its data.

Should I run any command to better see my configuration? Just le me know.

Thanks

ivytoba

ivytoba
2009-01-20, 02:44 PM CST
I forgot to show this after those commands I run:

# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2

# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [139.97 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.00 GB] inherit

Thanks again,

ivytoba

brunson
2009-01-20, 02:48 PM CST
The easiest solution to your problem may be to put the old drive into the computer, boot off it, then rename the volume group. I'm not sure how to differentiate between two different volume groups that are named the same when renaming, I'd be afraid of renaming the wrong one.

ivytoba
2009-01-20, 02:51 PM CST
Sound reasonable to me. What program would you use to change the volume name?

I thought that system-config-lvm would do it but I do not find a "change vlume name" thing.

ivytoba

brunson
2009-01-20, 02:55 PM CST
Maybe "vgrename"? You think? :-)

ivytoba
2009-01-20, 02:57 PM CST
I'll give it a shot.

Back to the screw driver now...

ivytoba

leigh123linux
2009-01-20, 03:04 PM CST
You need to use the vg uuid number to rename .

http://forums.fedoraforum.org/showthread.php?t=210977