Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- yum install parted -y
- parted /dev/sda
- (parted) unit MB print free
- Model: QEMU QEMU HARDDISK (scsi)
- Disk /dev/sda: 53687MB
- Sector size (logical/physical): 512B/512B
- Partition Table: msdos
- Number Start End Size Type File system Flags
- 0.03MB 1.05MB 1.02MB Free Space
- 1 1.05MB 525MB 524MB primary ext4 boot
- 2 525MB 10737MB 10212MB primary lvm
- 10737MB 53687MB 42950MB Free Space
- mkpart primary ext4 10737 53687
- quit
- reboot
- [root@ip179 ~]# parted /dev/sda
- GNU Parted 2.1
- Using /dev/sda
- Welcome to GNU Parted! Type 'help' to view a list of commands.
- (parted) print
- Model: QEMU QEMU HARDDISK (scsi)
- Disk /dev/sda: 53.7GB
- Sector size (logical/physical): 512B/512B
- Partition Table: msdos
- Number Start End Size Type File system Flags
- 1 1049kB 525MB 524MB primary ext4 boot
- 2 525MB 10.7GB 10.2GB primary lvm
- 3 10.7GB 53.7GB 42.9GB primary
- (parted) ^C
- (parted) quit
- [root@ip179 ~]# pvcreate /dev/sda3
- Physical volume "/dev/sda3" successfully created
- [root@ip179 ~]# vgextend VolGroup /dev/sda3
- Volume group "VolGroup" successfully extended
- [root@ip179 ~]# ^C
- [root@ip179 ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/mapper/VolGroup-lv_root
- 8.3G 842M 7.1G 11% /
- tmpfs 498M 0 498M 0% /dev/shm
- /dev/sda1 477M 52M 400M 12% /boot
- [root@ip179 ~]# vgdisplay
- --- Volume group ---
- VG Name VolGroup
- System ID
- Format lvm2
- Metadata Areas 2
- Metadata Sequence No 4
- VG Access read/write
- VG Status resizable
- MAX LV 0
- Cur LV 2
- Open LV 2
- Max PV 0
- Cur PV 2
- Act PV 2
- VG Size 49.50 GiB
- PE Size 4.00 MiB
- Total PE 12673
- Alloc PE / Size 2434 / 9.51 GiB
- Free PE / Size 10239 / 40.00 GiB
- VG UUID tp0a2o-Hkup-3V0m-01K1-udfY-Y2l2-gTMHjg
- [root@ip179 ~]# resize2fs /dev/VolGroup/lv_root
- resize2fs 1.41.12 (17-May-2010)
- The filesystem is already 2238464 blocks long. Nothing to do!
- [root@ip179 ~]# lvextend /dev/VolGroup/lv_root /dev/sda3
- Size of logical volume VolGroup/lv_root changed from 8.54 GiB (2186 extents) to 48.54 GiB (12425 extents).
- Logical volume lv_root successfully resized.
- [root@ip179 ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/mapper/VolGroup-lv_root
- 8.3G 842M 7.1G 11% /
- tmpfs 498M 0 498M 0% /dev/shm
- /dev/sda1 477M 52M 400M 12% /boot
- [root@ip179 ~]# lvresize --extents +100%FREE --resizefs /dev/VolGroup/lv_root
- [root@ip179 ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/mapper/VolGroup-lv_root
- 8.3G 842M 7.1G 11% /
- tmpfs 498M 0 498M 0% /dev/shm
- /dev/sda1 477M 52M 400M 12% /boot
- [root@ip179 ~]#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement