Chinaunix首页 | 论坛 | 博客
  • 博客访问: 793300
  • 博文数量: 180
  • 博客积分: 4447
  • 博客等级: 上校
  • 技术积分: 1582
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-03 14:51
文章分类

全部博文(180)

文章存档

2014年(6)

2013年(8)

2011年(125)

2009年(35)

2008年(1)

2007年(5)

分类: LINUX

2011-05-09 20:28:08

[root@rheltest1 ~]#pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created
[root@rheltest1 ~]#pvcreate /dev/sdb2
  Physical volume "/dev/sdb2" successfully created
[root@rheltest1 ~]#pvs
  PV         VG         Fmt  Attr PSize   PFree  
  /dev/sda3  VolGroup00 lvm2 a-    18.88G      0
  /dev/sdb1             lvm2 a-   486.31M 486.31M
  /dev/sdb2             lvm2 a-   466.35M 466.35M

[root@rheltest1 ~]#vgcreate VG01 /dev/sdb1 /dev/sdb2
  /dev/cdrom: open failed: Read-only file system
  /dev/cdrom: open failed: Read-only file system
  /dev/cdrom: open failed: Read-only file system
  /dev/cdrom: open failed: Read-only file system
  Volume group "VG01" successfully created
[root@rheltest1 ~]#vgs
  VG         #PV #LV #SN Attr   VSize   VFree  
  VG01         2   0   0 wz--n- 948.00M 948.00M
  VolGroup00   1   2   0 wz--n-  18.88G      0
[root@rheltest1 ~]#lvcreate -L 400M  VG01 -n LV01
  Logical volume "LV01" created
[root@rheltest1 ~]#lvs
  LV       VG         Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  LV01     VG01       -wi-a- 400.00M                                      
  LogVol00 VolGroup00 -wi-ao  11.72G                                      
  LogVol01 VolGroup00 -wi-ao   7.16G                                      

[root@rheltest1 ~]#mkfs.ext3 /dev/mapper/VG01-LV01
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
102400 inodes, 409600 blocks
20480 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
50 block groups
8192 blocks per group, 8192 fragments per group
2048 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 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@rheltest1 ~]#fdisk -l

Disk /dev/sda: 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/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         144     1052257+  82  Linux swap / Solaris
/dev/sda3             145        2610    19808145   8e  Linux LVM

Disk /dev/sdb: 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/sdb1               1          62      497983+  8e  Linux LVM
/dev/sdb2              63         122      477540   8e  Linux LVM
Partition 2 does not end on cylinder boundary.
[root@rheltest1 ~]#mkdir test
[root@rheltest1 ~]#mount /dev/
Display all 203 possibilities? (y or n)
[root@rheltest1 ~]#mount /dev/VG01/LV01 /root/test/
[root@rheltest1 ~]#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
                      7.0G  3.8G  2.9G  57% /
/dev/mapper/VolGroup00-LogVol00
                       12G  158M   11G   2% /usr/local
/dev/sda1              99M   20M   74M  22% /boot
tmpfs                 217M     0  217M   0% /dev/shm
none                  217M  104K  217M   1% /var/lib/xenstored
/dev/hdc              3.0G  3.0G     0 100% /media/RHEL_5.6 i386 DVD
/dev/mapper/VG01-LV01
                      388M   11M  358M   3% /root/test
[root@rheltest1 ~]#umount /root/test/
[root@rheltest1 ~]#lvresize -L 800M /dev/V
VG01/       VolGroup00/
[root@rheltest1 ~]#lvresize -L 800M /dev/VG01/LV01
  Extending logical volume LV01 to 800.00 MB
  Logical volume LV01 successfully resized
[root@rheltest1 ~]#mount /dev/VG01/LV01 /root/test/
[root@rheltest1 ~]#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
                      7.0G  3.8G  2.9G  57% /
/dev/mapper/VolGroup00-LogVol00
                       12G  158M   11G   2% /usr/local
/dev/sda1              99M   20M   74M  22% /boot
tmpfs                 217M     0  217M   0% /dev/shm
none                  217M  104K  217M   1% /var/lib/xenstored
/dev/hdc              3.0G  3.0G     0 100% /media/RHEL_5.6 i386 DVD
/dev/mapper/VG01-LV01
                      388M   11M  358M   3% /root/test
[root@rheltest1 ~]#umount /root/test/              
[root@rheltest1 ~]#resize2fs /dev/VG01/LV01 700M
resize2fs 1.39 (29-May-2006)
Please run 'e2fsck -f /dev/VG01/LV01' first.

[root@rheltest1 ~]#e2fsck -f /dev/VG01/LV01
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VG01/LV01: 11/102400 files (9.1% non-contiguous), 23472/409600 blocks
[root@rheltest1 ~]#resize2fs /dev/VG01/LV01 700M
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/VG01/LV01 to 716800 (1k) blocks.
The filesystem on /dev/VG01/LV01 is now 716800 blocks long.

[root@rheltest1 ~]#mount /dev/VG01/LV01 /root/test/
[root@rheltest1 ~]#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
                      7.0G  3.8G  2.9G  57% /
/dev/mapper/VolGroup00-LogVol00
                       12G  158M   11G   2% /usr/local
/dev/sda1              99M   20M   74M  22% /boot
tmpfs                 217M     0  217M   0% /dev/shm
none                  217M  104K  217M   1% /var/lib/xenstored
/dev/hdc              3.0G  3.0G     0 100% /media/RHEL_5.6 i386 DVD
/dev/mapper/VG01-LV01
                      678M   11M  633M   2% /root/test
[root@rheltest1 ~]#ls
1.txt  anaconda-ks.cfg  Desktop  install.log  install.log.syslog  test
[root@rheltest1 ~]#resize2fs /dev/VG01/LV01
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VG01/LV01 is mounted on /root/test; on-line resizing required
Performing an on-line resize of /dev/VG01/LV01 to 819200 (1k) blocks.
The filesystem on /dev/VG01/LV01 is now 819200 blocks long.

[root@rheltest1 ~]#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
                      7.0G  3.8G  2.9G  57% /
/dev/mapper/VolGroup00-LogVol00
                       12G  158M   11G   2% /usr/local
/dev/sda1              99M   20M   74M  22% /boot
tmpfs                 217M     0  217M   0% /dev/shm
none                  217M  104K  217M   1% /var/lib/xenstored
/dev/hdc              3.0G  3.0G     0 100% /media/RHEL_5.6 i386 DVD
/dev/mapper/VG01-LV01
                      775M   11M  725M   2% /root/test
[root@rheltest1 ~]#lvresize -L 850M /dev/VG01/LV01   
  Rounding up size to full physical extent 852.00 MB
  Extending logical volume LV01 to 852.00 MB
  Logical volume LV01 successfully resized
[root@rheltest1 ~]#resize2fs /dev/VG01/LV01
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VG01/LV01 is mounted on /root/test; on-line resizing required
Performing an on-line resize of /dev/VG01/LV01 to 872448 (1k) blocks.
The filesystem on /dev/VG01/LV01 is now 872448 blocks long.

[root@rheltest1 ~]#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
                      7.0G  3.8G  2.9G  57% /
/dev/mapper/VolGroup00-LogVol00
                       12G  158M   11G   2% /usr/local
/dev/sda1              99M   20M   74M  22% /boot
tmpfs                 217M     0  217M   0% /dev/shm
none                  217M  104K  217M   1% /var/lib/xenstored
/dev/hdc              3.0G  3.0G     0 100% /media/RHEL_5.6 i386 DVD
/dev/mapper/VG01-LV01
                      825M   11M  773M   2% /root/test

阅读(1168) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~