How to: mount Logical Volume Drive as External Device to Linux File System
Friday, October 16th, 2009First of all, we have to check if this hard disk is recognized by the system:
root@localhost ~]# fdisk -l
Let’s say your drive is assigned /dev/sdc. Then we scan for logical volumes so you’ll see something like this:
Disk /dev/sdc: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 13 104391 83 Linux
/dev/sdc2 14 1670 13309852+ f W95 Ext’d (LBA)
/dev/sdc3 1671 2434 6136830 8e Linux LVM
/dev/sdc5 14 75 497983+ 82 Linux swap / Solaris
/dev/sdc6 76 1670 12811806 83 Linux
Next we scan for physical volumes:
root@localhost ~]# pvscan
You’ll get:
PV /dev/sdc3 VG VolGroup00 lvm2 [5.84 GB / 32.00 MB free]
Total: 1 [5.84 GB] / in use: 1 [5.84 GB] / in no VG: 0 [0 ]
Then scan for logical volumes:
root@localhost ~]# lvscan
You’ll get:
inactive ‘/dev/VolGroup00/LogVol00′ [5.31 GB] inherit
inactive ‘/dev/VolGroup00/LogVol01′ [512.00 MB] inherit
Logical volume that we want to access must be active, therefore we type in:
root@localhost ~]# /usr/sbin/lvchange -a y /dev/VolGroup00/LogVol00
Then mount to file system:
root@localhost ~]# mount -t ext3 /dev/VolGroup00/LogVol00 /mnt/
When done, unmount and revert to inactive mode:
root@localhost ~]# /usr/sbin/lvchange -a n /dev/VolGroup00/LogVol00