[root@Mars /]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda1 12192608 1507360 10055904 14% /
tmpfs 387336 0 387336 0% /dev/shm
[root@Mars /]# fdisk -l
Disk /dev/vda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/vda1 * 1 1567 12586896 83 Linux
/dev/vda2 1568 2610 8377897+ 82 Linux swap / Solaris
Disk /dev/vdb: 128.8 GB, 128849018880 bytes
16 heads, 63 sectors/track, 249660 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk /dev/vdb doesn't contain a valid partition table
[root@Mars /]# df -hal
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 12G 1.5G 9.6G 14% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
tmpfs 379M 0 379M 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
[root@Mars /]# pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created
[root@Mars /]# pvdisplay
"/dev/vdb" is a new physical volume of "120.00 GB"
--- NEW Physical volume ---
PV Name /dev/vdb
VG Name
PV Size 120.00 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID bYNkM5-P4tN-0NSb-BLeL-oBSC-v4XO-8mM8bs
[root@Mars /]# vgcreate VolGroup00 /dev/vdb
Volume group "VolGroup00" successfully created
[root@Mars /]# pvdisplay
--- Physical volume ---
PV Name /dev/vdb
VG Name VolGroup00
PV Size 120.00 GB / not usable 4.00 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 30719
Free PE 30719
Allocated PE 0
PV UUID bYNkM5-P4tN-0NSb-BLeL-oBSC-v4XO-8mM8bs
[root@Mars /]# lvcreate -L 100GB -n lvhome VolGroup00
Logical volume "lvhome" created
[root@Mars /]# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/lvhome
VG Name VolGroup00
LV UUID 3n2WWN-6Otw-AY0p-ut4C-WbIV-M8oV-RMrm90
LV Write Access read/write
LV Status available
# open 0
LV Size 100.00 GB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
[root@Mars /]# mkfs -t ext3 /dev/VolGroup00/lvhome
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
13107200 inodes, 26214400 blocks
1310720 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
800 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@Mars /]# mount /dev/VolGroup00/lvhome /home
[root@Mars /]# vi /etc/fstab
/dev/VolGroup00/lvhome /home ext3 defaults 1 2
[root@Mars /]# reboot
重新挂载硬盘
[root@s013003160033 VolGroup]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 80.00 GiB
PE Size 4.00 MiB
Total PE 20479
Alloc PE / Size 20429 / 79.80 GiB
Free PE / Size 50 / 200.00 MiB
VG UUID PbTAFZ-WzwJ-iaxh-3sbb-et2B-zppn-1LrOJN
--- Volume group ---
VG Name VolGroup
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 19.51 GiB
PE Size 4.00 MiB
Total PE 4994
Alloc PE / Size 4994 / 19.51 GiB
Free PE / Size 0 / 0
VG UUID hl0gSP-2ElV-wONd-cRBp-e68Z-OQ26-nklnM1
[root@s013003160033 VolGroup]# vgrename PbTAFZ-WzwJ-iaxh-3sbb-et2B-zppn-1LrOJN d ata
Volume group "VolGroup00" successfully renamed to "data"
[root@s013003160033 dev]# lvscan
inactive '/dev/data/lvhome' [79.80 GiB] inherit
ACTIVE '/dev/VolGroup/lv_root' [17.51 GiB] inherit
ACTIVE '/dev/VolGroup/lv_swap' [2.00 GiB] inherit
[root@s013003160033 dev]# vgchange -ay /dev/data
1 logical volume(s) in volume group "data" now active
[root@s013003160033 dev]# mount /dev/data/lvhome /home[
[root@s013003160033 dev]# mv /home1/* /home/
mv: overwrite `/home/ftp'? Y
mv: overwrite `/home/tmp'? y
[root@s013003160033 dev]# vi /etc/fstab
/dev/data/lvhome /home ext3 defaults 1 2
[root@s013003160033 dev]# reboot
最新评论