[root@localhost scripts]# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4be4ed4
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-391, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-391, default 391): 191
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (192-391, default 192):
Using default value 192
Last cylinder, +cylinders or +size{K,M,G} (192-391, default 391): 292
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (293-391, default 293):
Using default value 293
Last cylinder, +cylinders or +size{K,M,G} (293-391, default 391):
Using default value 391
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost scripts]# fdisk -l
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4be4ed4
Device Boot Start End Blocks Id System
/dev/sdb1 1 191 1534176 83 Linux
/dev/sdb2 192 292 811282+ 83 Linux
/dev/sdb3 293 391 795217+ 83 Linux
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004c204
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 39163 314059776 8e Linux LVM
Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_home: 263.7 GB, 263746224128 bytes
255 heads, 63 sectors/track, 32065 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
[root@localhost scripts]# pvcreate /dev/sdb1 /dev/sdb2
Physical volume "/dev/sdb1" successfully created
Physical volume "/dev/sdb2" successfully created
[root@localhost scripts]# pvremove
Please enter a physical volume path
Run `pvremove --help' for more information.
[root@localhost scripts]# pvremove /dev/sdb1 /dev/sdb2
Labels on physical volume "/dev/sdb1" successfully wiped
Labels on physical volume "/dev/sdb2" successfully wiped
[root@localhost scripts]# fdisk /dev/sdb
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)
Command (m for help): t
Partition number (1-4): 4
Partition 4 does not exist yet!
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost scripts]# pvcreate /dev/sdb1 /dev/sdb2
Physical volume "/dev/sdb1" successfully created
Physical volume "/dev/sdb2" successfully created
[root@localhost scripts]# vgcreate vg_cipan-3G /dev/sdb1 /dev/sdb2
Volume group "vg_cipan-3G" successfully created
[root@localhost scripts]# vgremove vg_cipan-3G
Volume group "vg_cipan-3G" successfully removed
[root@localhost scripts]# vgcreate vg_cipan-3G /dev/sdb1 /dev/sdb2
Volume group "vg_cipan-3G" successfully created
[root@localhost scripts]# VGS
-bash: VGS: command not found
[root@localhost scripts]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup 1 3 0 wz--n- 299.51g 0
vg_cipan-3G 2 0 0 wz--n- 2.23g 2.23g
[root@localhost scripts]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup lvm2 a-- 299.51g 0
/dev/sdb1 vg_cipan-3G lvm2 a-- 1.46g 1.46g
/dev/sdb2 vg_cipan-3G lvm2 a-- 788.00m 788.00m
[root@localhost scripts]# lvcreate -L 500M -n lv01 vg_cipan-3G
Logical volume "lv01" created
[root@localhost scripts]# lvremove LV01
Volume group "LV01" not found
Skipping volume group LV01
[root@localhost scripts]# lvremove lv01
Volume group "lv01" not found
Skipping volume group lv01
[root@localhost scripts]# lvremove lv01
Volume group "lv01" not found
Skipping volume group lv01
[root@localhost scripts]# lvremove /dev/vg_copan-3G/lv01
Volume group "vg_copan-3G" not found
Skipping volume group vg_copan-3G
[root@localhost scripts]# lvremove lv01
Volume group "lv01" not found
Skipping volume group lv01
[root@localhost scripts]# mkfs.ext4 /dev/vg_cipan-3G/lv01
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@localhost scripts]# lvremove lv01
Volume group "lv01" not found
Skipping volume group lv01
[root@localhost scripts]# lvremove /dev/vg_cipan-3G/lv01
Do you really want to remove active logical volume lv01? [y/n]:
Logical volume "lv01" successfully removed
[root@localhost scripts]# lvcreate -L 500M -n lv01 vg_cipan-3G
Logical volume "lv01" created