LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem mounting LVM (https://www.linuxquestions.org/questions/linux-newbie-8/problem-mounting-lvm-415598/)

conalmc 02-15-2006 03:23 AM

problem mounting LVM
 
Hello

I am having a problem mounting an LVM partition. Basically , I have had to do a fresh install of centos4.2 on a new drive. I need to mount the root partition from the old drive. The old drive is not damaged in anyway and still works. I need to mount /dev/hdc2 so i can access the data. Here are my results:

[root@server /]# mount /dev/hdc2 /oldroot
mount: /dev/hdc2 already mounted or /oldroot busy

Here is the fdisk -l info:

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 274 2096482+ 82 Linux swap
/dev/hda3 275 535 2096482+ 83 Linux
/dev/hda4 536 24321 191061045 5 Extended
/dev/hda5 536 24321 191061013+ 83 Linux

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 13 104391 83 Linux
/dev/hdc2 14 9729 78043770 8e Linux LVM

/dev/hdc1 obviously has no issue mounting. The /oldroot directory in which i am trying to mount to is completely empty and is does not have any partitions mounted to it. Any help/suggestions would be awsome.

Thank
Conal

satinet 02-15-2006 08:27 AM

surely the old root wont be in your lvm tab? also, you dont specify a file system type in your mount command....

MensaWater 02-15-2006 08:42 AM

It's telling you something is already in use/busy.

Try running lsof against both the device and the mount point to see if either is in fact actually in use.

haertig 02-15-2006 12:29 PM

You don't mount an LVM partition directly. You mount the logical volumes contained within the LVM partition. The error message you're getting is misleading, to say the least. But I think the root cause of your problem is the incorrect way you're attempting to use the partition.

See the LVM mounting example from my system below. I have LVM on /dev/sd8 but you can see that /dev/sd8 is NOT directly mounted anywhere. The individual LV's inside the LVM partition are mounted, e.g., /dev/mapper/vg0-usr is mounted on /usr, /dev/mapper/vg0-var is mounted on /var, etc.
Code:

# fdisk -l

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        5099    40957686    7  HPFS/NTFS
/dev/sda2            5100      10199    40965750    7  HPFS/NTFS
/dev/sda3          10200      14024    30724312+  c  W95 FAT32 (LBA)
/dev/sda4          14025      19452    43600410    f  W95 Ext'd (LBA)
/dev/sda5  *      14025      14030      48163+  83  Linux
/dev/sda6          14031      14091      489951  82  Linux swap / Solaris
/dev/sda7          14092      14213      979933+  83  Linux
/dev/sda8          14214      19452    42082236  8e  Linux LVM
# mount
/dev/sda7 on / type ext3 (rw,errors=remount-ro)
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)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda5 on /boot type ext3 (rw)
/dev/mapper/vg0-usr on /usr type ext3 (rw)
/dev/mapper/vg0-var on /var type ext3 (rw)
/dev/mapper/vg0-opt on /opt type ext3 (rw)
/dev/mapper/vg0-tmp on /tmp type ext3 (rw)
/dev/mapper/vg0-home on /home type ext3 (rw)
/dev/sda1 on /mnt/windows/c type ntfs (ro,umask=0222)
/dev/sda2 on /mnt/windows/d type ntfs (ro,umask=0222)
/dev/sda3 on /mnt/windows/e type vfat (rw,umask=0000)
tmpfs on /dev type tmpfs (rw,size=10M,mode=0755)
#

Here are the LVM related entries in my /etc/fstab:
Code:

...
#
# Logical Volume Management (LVM2 on /dev/sda8)
# Note: /usr/local is symlinked to /opt
#
/dev/mapper/vg0-usr  /usr      ext3    defaults                    0      2
/dev/mapper/vg0-var  /var      ext3    defaults                    0      2
/dev/mapper/vg0-opt  /opt      ext3    defaults                    0      2
/dev/mapper/vg0-tmp  /tmp      ext3    defaults                    0      2
/dev/mapper/vg0-home /home      ext3    defaults                    0      2
...



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