[root@localhost ~]# fdisk -l Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes 255 heads, 63 sectors/track, 17844 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 16 128488+ 83 Linux /dev/cciss/c0d0p2 17 799 6289447+ 83 Linux /dev/cciss/c0d0p4 1322 17844 132720997+ 5 Extended /dev/cciss/c0d0p6 2105 2626 4192933+ 82 Linux swap Disk /dev/cciss/c0d1: 293.5 GB, 293564211200 bytes 255 heads, 32 sectors/track, 70265 cylinders Units = cylinders of 8160 * 512 = 4177920 bytes Disk /dev/cciss/c0d1 doesn't contain a valid partition table
[root@localhost ~]# pvcreate /dev/cciss/c0d1 Physical volume "/dev/cciss/c0d1" successfully created
[root@localhost ~]# pvdisplay -v Scanning for physical volume names --- Physical volume --- PV Name /dev/cciss/c0d1 VG Name data PV Size 273.40 GB / not usable 664.00 KB Allocatable yes PE Size (KByte) 4096 Total PE 69991 Free PE 46698 Allocated PE 23293 PV UUID ElM1rp-UYEw-KlV8-JjGu-cO17-5BIo-plyXXq
[root@localhost ~]# vgcreate data /dev/cciss/c0d1 Volume group "data" successfully created
[root@localhost ~]# vgdisplay -v Finding all volume groups Finding volume group "data" --- Volume group --- VG Name data System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 272.24 GB PE Size 4.00 MB Total PE 69694 Alloc PE / Size 0 / 0 Free PE / Size 69694 / 272.24 GB VG UUID 7UcyGl-TYPr-3c82-2oew-eJ3F-6Z1b-mVtM7G --- Physical volumes --- PV Name /dev/cciss/c0d1 PV UUID 7Y4Vze-WR95-uDDJ-exi8-IPVD-gEEW-Tqpuy2 PV Status allocatable Total PE / Free PE 69694 / 69694
[root@localhost ~]# lvcreate -L 60G -n mysql data Logical volume "mysql" created
[root@localhost ~]#lvdisplay -v Finding all logical volumes --- Logical volume --- LV Name /dev/data/mysql VG Name data LV UUID bO5R6V-UVhX-yaJw-Ap0a-fQIe-AfYy-OJ0XyT LV Write Access read/write LV Status available # open 1 LV Size 90.99 GB Current LE 23293 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:0
[root@localhost ~]# lvresize -L +10G /dev/data/mysql Extending logical volume mysql to 70.00 GB Logical volume mysql successfully resized
[root@localhost ~]# mkfs.ext3 -j /dev/data/mysql ...... ......
[root@localhost ~]# ext2online /dev/data/mysql ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
[root@localhost ~]# mount /dev/data/mysql /mysql [root@localhost ~]# ls -l /mysql/ total 0
[root@localhost ~]# cp test.tgz /mysql [root@localhost ~]# ls -l /mysql total 1176 -rw-r--r-- 1 root root 1196796 May 5 16:20 test.tgz
[root@localhost ~]# lvcreate -L 10M -s -n snap /dev/data/mysql Rounding up size to full physical extent 12.00 MB Logical volume "snap" created
[root@localhost ~]# mount /dev/data/snap /snap [root@localhost ~]# ls -l /snap total 1176 -rw-r--r-- 1 root root 1196796 May 5 16:20 linux.tgz
本文出自 “爱MySQL” 博客,转载请与作者联系!