Linux Partition Resize

For LVM:
 
sudo yum -y install cloud-utils-growpart
 
lsblk
 
pvs
 
ls /sys/class/scsi_device/
0:0:0:0 1:0:0:0
 
echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan
 
lsblk
 
growpart /dev/sda 2
 
pvresize /dev/sda2
 
 
lvextend -r -l +100%FREE /dev/name-of-volume-group/root
 
 
For XFS
 
user@user-srv ~]$ df -h
 
[user@user-srv ~]$ sudo fdisk /dev/sda
 
Command (m for help): c
DOS Compatibility flag is not set
 
Command (m for help): u
Changing display/entry units to sectors
 
Command (m for help): n
Command action
  e   extended
  p   primary partition (1-4)
p
Partition number (1-4): 1
Partition 1 is already defined.  Delete it before re-adding it.
 
Command (m for help): d
Selected partition 1
 
Command (m for help): n
Command action
  e   extended
  p   primary partition (1-4)
p
Partition number (1-4): 1
 
Command (m for help): a
 
Command (m for help): w
The partition table has been altered!
 
[user@user-srv ~]$ partx /dev/sda
 
[user@user-srv ~]$ sudo reboot
 
[user@user-srv ~]$ sudo resize2fs /dev/sda1

 

  • linux, resize, partition, resize2fs
  • 0 användare blev hjälpta av detta svar
Hjälpte svaret dig?