Menu

Resize home and root partition in centos 7

As others have pointed out, XFS filesystem cannot be shrunk.
So your best bet is to backup /home, remove and recreate its volume in a smaller size and give the rest to your /root volume just as Koen van der Rijt outlined in his post.
• backup the contents of /home
> tar -czvf /root/home.tgz -C /home .
• test the backup
> tar -tvf /root/home.tgz
• unmount home
> umount /dev/mapper/centos-home
• remove the home logical volume
> lvremove /dev/mapper/centos-home
• recreate a new 400GB logical volume for /home, format and mount it
> lvcreate -L 400GB -n home centos
> mkfs.xfs /dev/centos/home
> mount /dev/mapper/centos-home
• extend your /root volume with ALL of the remaining space and resize (-r) the file system while doing so
> lvextend -r -l +100%FREE /dev/mapper/centos-root
• restore your backup
> tar -xzvf /root/home.tgz -C /home
• check /etc/fstab for any mapping of /home volume. IF it is using UUID you should update the UUID portion. (Since we created a new volume, UUID has changed)
That's it.
Hope this helps.

3 nhận xét :

  1. They come in various styles, from simple and understated designs to vibrant patterns and fun animal costumes. This range ensures that there's a shark onesie for every taste and event, whether you prefer a classic flannel pattern or a whimsical unicorn outfit.

    Trả lờiXóa
  2. This versatility makes them an appealing choice for individuals looking to express their personality while staying comfortable. Furthermore, adult onesies are practical beyond just fashion. Many designs feature zippered fronts, footie bottoms, and even hoods, adding layers of convenience and warmth. This functionality is perfect for chilly evenings or lazy weekends. As the popularity of adult dinosaur onesie continues to grow, their ability to blend comfort, practicality, and style ensures they will remain a beloved garment choice for years to come.

    Trả lờiXóa