4.2. 物​​​​​​​理​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​

这​​​​​​​部​​​​​​​分​​​​​​​论​​​​​​​述​​​​​​​了​​​​​​​对​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​不​​​​​​​同​​​​​​​方​​​​​​​面​​​​​​​进​​​​​​​行​​​​​​​管​​​​​​​理​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​

4.2.1. 创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

下​​​​​​​面​​​​​​​的​​​​​​​子​​​​​​​部​​​​​​​分​​​​​​​论​​​​​​​述​​​​​​​了​​​​​​​创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​

4.2.1.1. 设​​​​​​​定​​​​​​​分​​​​​​​区​​​​​​​类​​​​​​​型​​​​​​​

如​​​​​​​果​​​​​​​您​​​​​​​将​​​​​​​整​​​​​​​张​​​​​​​磁​​​​​​​盘​​​​​​​作​​​​​​​为​​​​​​​您​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​使​​​​​​​用​​​​​​​,那​​​​​​​么​​​​​​​磁​​​​​​​盘​​​​​​​就​​​​​​​必​​​​​​​须​​​​​​​没​​​​​​​有​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​。​​​​​​​对​​​​​​​于​​​​​​​ DOS 磁​​​​​​​盘​​​​​​​分​​​​​​​区​​​​​​​,您​​​​​​​应​​​​​​​该​​​​​​​用​​​​​​​ fdisk 或​​​​​​​者​​​​​​​ cfdisk 或​​​​​​​者​​​​​​​等​​​​​​​同​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​分​​​​​​​区​​​​​​​ id 设​​​​​​​为​​​​​​​ 0x8e。​​​​​​​如​​​​​​​果​​​​​​​将​​​​​​​整​​​​​​​张​​​​​​​磁​​​​​​​盘​​​​​​​作​​​​​​​为​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​使​​​​​​​用​​​​​​​就​​​​​​​必​​​​​​​须​​​​​​​擦​​​​​​​除​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​,这​​​​​​​也​​​​​​​就​​​​​​​会​​​​​​​有​​​​​​​效​​​​​​​地​​​​​​​破​​​​​​​坏​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​现​​​​​​​有​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​扇​​​​​​​区​​​​​​​归​​​​​​​零​​​​​​​,从​​​​​​​而​​​​​​​删​​​​​​​除​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​:
dd if=/dev/zero of=PhysicalVolume bs=512 count=1

4.2.1.2. 初​​​​​​​始​​​​​​​化​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

使​​​​​​​用​​​​​​​ pvcreate 命​​​​​​​令​​​​​​​来​​​​​​​将​​​​​​​一​​​​​​​个​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​为​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​和​​​​​​​格​​​​​​​式​​​​​​​化​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​类​​​​​​​似​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​ /dev/sdd1、​​​​​​​/dev/sde1 和​​​​​​​ /dev/sdf1,将​​​​​​​其​​​​​​​作​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​
pvcreate /dev/sdd1 /dev/sde1 /dev/sdf1
要​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​分​​​​​​​区​​​​​​​而​​​​​​​不​​​​​​​是​​​​​​​整​​​​​​​张​​​​​​​磁​​​​​​​盘​​​​​​​,请​​​​​​​在​​​​​​​分​​​​​​​区​​​​​​​中​​​​​​​运​​​​​​​行​​​​​​​ pvcreate。​​​​​​​以​​​​​​​下​​​​​​​给​​​​​​​出​​​​​​​了​​​​​​​将​​​​​​​ /dev/hdb1 初​​​​​​​始​​​​​​​化​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​,以​​​​​​​便​​​​​​​以​​​​​​​后​​​​​​​成​​​​​​​为​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​一​​​​​​​部​​​​​​​分​​​​​​​的​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​
pvcreate /dev/hdb1

4.2.1.3. 扫​​​​​​​描​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvmdiskscan 命​​​​​​​令​​​​​​​来​​​​​​​扫​​​​​​​描​​​​​​​用​​​​​​​作​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​,示​​​​​​​例​​​​​​​如​​​​​​​下​​​​​​​。​​​​​​​
# lvmdiskscan
/dev/ram0                    [       16.00 MB]
  /dev/sda                     [       17.15 GB]
  /dev/root                    [       13.69 GB]
  /dev/ram                     [       16.00 MB]
  /dev/sda1                    [       17.14 GB] LVM physical volume
  /dev/VolGroup00/LogVol01     [      512.00 MB]
  /dev/ram2                    [       16.00 MB]
  /dev/new_vg/lvol0            [       52.00 MB]
  /dev/ram3                    [       16.00 MB]
  /dev/pkl_new_vg/sparkie_lv   [        7.14 GB]
  /dev/ram4                    [       16.00 MB]
  /dev/ram5                    [       16.00 MB]
  /dev/ram6                    [       16.00 MB]
  /dev/ram7                    [       16.00 MB]
  /dev/ram8                    [       16.00 MB]
  /dev/ram9                    [       16.00 MB]
  /dev/ram10                   [       16.00 MB]
  /dev/ram11                   [       16.00 MB]
  /dev/ram12                   [       16.00 MB]
  /dev/ram13                   [       16.00 MB]
  /dev/ram14                   [       16.00 MB]
  /dev/ram15                   [       16.00 MB]
  /dev/sdb                     [       17.15 GB]
  /dev/sdb1                    [       17.14 GB] LVM physical volume
  /dev/sdc                     [       17.15 GB]
  /dev/sdc1                    [       17.14 GB] LVM physical volume
  /dev/sdd                     [       17.15 GB]
  /dev/sdd1                    [       17.14 GB] LVM physical volume
  7 disks
  17 partitions
  0 LVM physical volume whole disks
  4 LVM physical volumes