I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused". If tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive (something about too big).
Any thoughts or suggestions?
-Frank
Frank,
On 5/12/20 5:06 PM, Frank M. Ramaekers Jr. wrote:
I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused". If tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive (something about too big).
Any thoughts or suggestions?
If I was you, I would boot the SystemRescueCD, mount your /home partition. Then rsync the data to someplace else - another system on your network? If your root partition is also xfs, then mount/rsync that data as well. Then remove, expand or recreate your LVM based volumes, mkfs and rsync the data back. I'm assuming you have a /boot partition that is not LVM based so no need to reinstall grub. Then reboot.
Side note: my solution doesn't require you to set up a chroot, just mount the partition in order to back up the data on the filesystem. I like Gentoo's LVM documentation[0] Hope this helps.
[0] https://wiki.gentoo.org/wiki/LVM#Usage
Hi,
I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused". If tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive (something about too big).
Any thoughts or suggestions?
What is the problem if you boot directly into maintenance mode? Then it should be possible to backup home to a remote destination, unmount /home, remove the home LV, expand /, recreate home and mount it, restore from backup and you're done. No need to use any SystemRescueCD or other tool.
Regards, Simon
Yeah, I tried that but ran into a problem. It came up fine in single-user/maintenance mode. The mount command shows all of the mounted file systems, but after I 'chroot /sysroot', the mount failed (with some problem with mtab, sorry don't have the exact error message). So I couldn't mount my 32TB RAID (where the xfsdump file was).
On 5/13/2020 12:48 AM, Simon Matter via CentOS wrote:
Hi,
I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused". If tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive (something about too big).
Any thoughts or suggestions?
What is the problem if you boot directly into maintenance mode? Then it should be possible to backup home to a remote destination, unmount /home, remove the home LV, expand /, recreate home and mount it, restore from backup and you're done. No need to use any SystemRescueCD or other tool.
Regards, Simon
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Hi,
Yeah, I tried that but ran into a problem. It came up fine in single-user/maintenance mode. The mount command shows all of the mounted file systems, but after I 'chroot /sysroot', the mount failed (with some problem with mtab, sorry don't have the exact error message). So I couldn't mount my 32TB RAID (where the xfsdump file was).
I think you misunderstood what I meant. You appear to have booted into rescue mode, but that's not what I meant. What I meant is good old single user mode. The state you'll get with "telinit 1" or with "s" or "1" as a kernel boot option.
For what you want to do not a single reboot is required.
Regards, Simon
On 5/13/2020 12:48 AM, Simon Matter via CentOS wrote:
Hi,
I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused". If tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive (something about too big).
Any thoughts or suggestions?
What is the problem if you boot directly into maintenance mode? Then it should be possible to backup home to a remote destination, unmount /home, remove the home LV, expand /, recreate home and mount it, restore from backup and you're done. No need to use any SystemRescueCD or other tool.
Regards, Simon
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
I'll try that...I was using instructions I found on the internet for single-user/maintenance mode. From the grub screen you enter 'e' and modify the linux16 line...etc.
Okay, I'll try that next.
Thanks Simon!
On 5/13/2020 7:28 AM, Simon Matter via CentOS wrote:
Hi,
Yeah, I tried that but ran into a problem. It came up fine in single-user/maintenance mode. The mount command shows all of the mounted file systems, but after I 'chroot /sysroot', the mount failed (with some problem with mtab, sorry don't have the exact error message). So I couldn't mount my 32TB RAID (where the xfsdump file was).
I think you misunderstood what I meant. You appear to have booted into rescue mode, but that's not what I meant. What I meant is good old single user mode. The state you'll get with "telinit 1" or with "s" or "1" as a kernel boot option.
For what you want to do not a single reboot is required.
Regards, Simon
On 5/13/2020 12:48 AM, Simon Matter via CentOS wrote:
Hi,
I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused". If tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive (something about too big).
Any thoughts or suggestions?
What is the problem if you boot directly into maintenance mode? Then it should be possible to backup home to a remote destination, unmount /home, remove the home LV, expand /, recreate home and mount it, restore from backup and you're done. No need to use any SystemRescueCD or other tool.
Regards, Simon
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Hi,
XFS filesystems cannot be shrunk. If you need to shrink an XFS file system, then you have to backup the data, delete the entire filesystem, resize the volume in LVM, then create a new filesystem and restore the data from backup.
Ref: https://xfs.org/index.php/XFS_FAQ#Q:_Is_there_a_way_to_make_a_XFS_filesystem...
Jason --------------------------------------------------------------------------- Jason Edgecombe | Linux Administrator UNC Charlotte | The William States Lee College of Engineering 9201 University City Blvd. | Charlotte, NC 28223-0001 Phone: 704-687-1943 jwedgeco@uncc.edu | http://engr.uncc.edu | Facebook --------------------------------------------------------------------------- If you are not the intended recipient of this transmission or a person responsible for delivering it to the intended recipient, any disclosure, copying, distribution, or other use of any of the information in this transmission is strictly prohibited. If you have received this transmission in error, please notify me immediately by reply e-mail or by telephone at 704-687-1943. Thank you.
On Wed, May 13, 2020 at 1:05 PM Frank M. Ramaekers Jr. frank@ramaekers.com wrote:
I'll try that...I was using instructions I found on the internet for single-user/maintenance mode. From the grub screen you enter 'e' and modify the linux16 line...etc.
Okay, I'll try that next.
Thanks Simon!
On 5/13/2020 7:28 AM, Simon Matter via CentOS wrote:
Hi,
Yeah, I tried that but ran into a problem. It came up fine in single-user/maintenance mode. The mount command shows all of the mounted file systems, but after I 'chroot /sysroot', the mount failed (with some problem with mtab, sorry don't have the exact error message). So I couldn't mount my 32TB RAID (where the xfsdump file
was).
I think you misunderstood what I meant. You appear to have booted into rescue mode, but that's not what I meant. What I meant is good old single user mode. The state you'll get with "telinit 1" or with "s" or "1" as a kernel boot option.
For what you want to do not a single reboot is required.
Regards, Simon
On 5/13/2020 12:48 AM, Simon Matter via CentOS wrote:
Hi,
I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused".
If
tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB
drive
(something about too big).
Any thoughts or suggestions?
What is the problem if you boot directly into maintenance mode? Then it should be possible to backup home to a remote destination, unmount /home, remove the home LV, expand /, recreate home and mount it, restore from backup and you're done. No need to use any SystemRescueCD or other
tool.
Regards, Simon
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
"telinit" was what I needed, thanks again!
-Frank
On 5/13/2020 12:05 PM, Frank M. Ramaekers Jr. wrote:
I'll try that...I was using instructions I found on the internet for single-user/maintenance mode. From the grub screen you enter 'e' and modify the linux16 line...etc.
Okay, I'll try that next.
Thanks Simon!
On 5/13/2020 7:28 AM, Simon Matter via CentOS wrote:
Hi,
Yeah, I tried that but ran into a problem. It came up fine in single-user/maintenance mode. The mount command shows all of the mounted file systems, but after I 'chroot /sysroot', the mount failed (with some problem with mtab, sorry don't have the exact error message). So I couldn't mount my 32TB RAID (where the xfsdump file was).
I think you misunderstood what I meant. You appear to have booted into rescue mode, but that's not what I meant. What I meant is good old single user mode. The state you'll get with "telinit 1" or with "s" or "1" as a kernel boot option.
For what you want to do not a single reboot is required.
Regards, Simon
On 5/13/2020 12:48 AM, Simon Matter via CentOS wrote:
Hi,
I'm having some difficulty finding a method to shrink my /home to expand my /. They both correspond to LVMs. It is my understanding that one cannot shrink a xfs filesystem. One must back it up (xfsdump), remove (lvremove) redefine it and then restore it back (xfsrestore).
Okay, I'm running into a problem where /home needs to be "unused". If tried going in to "maintance mode", but I ran into a problem with the mount command (after issuing a 'chroot /sysroot'). I then tried using SystemRescueCD to boot to, but it wouldn't mount my 32TB RAID USB drive (something about too big).
Any thoughts or suggestions?
What is the problem if you boot directly into maintenance mode? Then it should be possible to backup home to a remote destination, unmount /home, remove the home LV, expand /, recreate home and mount it, restore from backup and you're done. No need to use any SystemRescueCD or other tool.
Regards, Simon
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
Correct, XFS filesystems cannot be shrunk (reduced) dynamically, like ext2/3/4 can, only grown. You need to create another, smaller filesystem (XFS too usually) then copy the existing content which can be done with tools like xfsdump & xfsrestore (iff both are XFS), rsync, pax (spax), or tar, typically while the system is in single user mode so that no changes can occur (and be lost). Which exact steps depend, as usual. If there's nothing on that USB drive you want then you can expand the VG onto it (gdisk, pvcreate then vgextend), make a new, smaller LV (lvcreate) and filesystem (mkfs), copy the content, remove the old LV (lvremove), then move the new LV off the USB array onto your normal storage (pvmove) then remove the USB array from the VG (vgreduce), at which point you should be able to grow (lvextend) your root.
/mark