<概要>
[Ubuntu 11.10]環境にて「RAID1のmdデバイスからLVM作成方法」を紹介します。
<事前確認>
1.Partitions構成確認
# lsblk
2.LVMに参加させるPhysical Volume
# pvcreate /dev/md125 (一例)
Physical volume “/dev/md125” successfully created
3.Physical Valume確認
# pvscan
<目次>
1.Volume Group Name作成
2.Volume Group 確認
3.Volume Group Size byte単位確認
4.Logical Volume作成
5.作成したLVのDeviceを確認する
6.File System Format
7.Partitions確認
8.LVのmountテスト
<作成手順>
1.Volume Group Name作成
# vgcreate VolGroup2 /dev/md125
Volume group “VolGroup2” successfully created
2.Volume Group 確認
# vgdisplay VolGroup2
3.Volume Group Size byte単位確認
# vgdisplay –units b VolGroup2
4.Logical Volume作成
# lvcreate -L 500095254528B -n LogicalVol01 VolGroup2
Logical volume “LogicalVol01” created
5.作成したLVのDeviceを確認する
# fdisk -l
…(省略)…
Disk /dev/mapper/VolGroup2-LogicalVol01: 500.1 GB, 500095254528 bytes
…(省略)…
6.File System Format:
# mkfs.ext4 /dev/mapper/VolGroup2-LogicalVol01
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=1 blocks, Stripe width=1 blocks
30523392 inodes, 122093568 blocks
6104678 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
3726 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
7.Partitions確認
# parted /dev/mapper/VolGroup2-LogicalVol01 print
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/VolGroup2-LogicalVol01: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 500GB 500GB ext4
8.LVのmountテスト
# mount /dev/mapper/VolGroup2-LogicalVol01 /hdd