Mount Linux LVM Partition

user-pic
Vote 0 Votes

要先裝 lvm2 套件

用 lvscan 或 lvdisplay 看一下有那些 VolGroup,
再用 vgchange 設為 active, 使 Kernel 看得到,
例如: vgchange VolGroup00 -a y
此步驟很重要, 指令下完才會有 VolGroup device node,
此時用 lvscan 就會看到 ACTIVE
最後就可以 mount 了
mount /dev/VolGroup00/LogVol00 /mnt

範例:
# fdisk -l /dev/sda

Disk /dev/sda: 9105 MB, 9105018880 bytes
255 heads, 63 sectors/track, 1106 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0a36d4a3

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1106 8779522+ 8e Linux LVM

# lvscan
inactive '/dev/VolGroup00/LogVol00' [7.81 GB] inherit
inactive '/dev/VolGroup00/LogVol01' [512.00 MB] inherit

# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID IBkdFv-Jlwn-8fyj-3ys3-F9em-zowk-7gnRKr
LV Write Access read/write
LV Status NOT available
LV Size 7.81 GB
Current LE 250
Segments 1
Allocation inherit
Read ahead sectors 0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID 7V0Wv7-1WkV-H2cR-NPqm-jTQY-tZkV-cbq4JX
LV Write Access read/write
LV Status NOT available
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors 0

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

# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [7.81 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [512.00 MB] inherit

# mount /dev/VolGroup00/LogVol00 /mnt

Leave a comment

About this Entry

This page contains a single entry by Pank published on December 2, 2008 10:11 AM.

Get Taiwan IPv4 Addresses from APNIC was the previous entry in this blog.

MySQL 5.1.30 may not ready for production use is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives