1

I have a CentOS machine on which I want to rearrange partition. The /dev/sda2 is too large(29GB) and I want to shrink it. It is a LVM and is Xfs file system. It has /dev/cl/root on it, 27GB. I want to shrink it to 25 G.

Now, the only way that works, is enter CD boot rescue mode, skip to shell and use lvmchange. But the filesystem cannot be altered because it is Xfs. Without the --resizefs param it seems possible, but I stopped because my data may be damaged. I have used 6G and there is 21G free. I know that xfs is not possible to shrink; I am looking for a way to change fs, if possible?

l am frustrated: Gparted is good but with /root mounted it is impossible to use in GUI, I have to desactivate it first. Why cannot I do online shrink partition? In Windows I can do that.

How does these kind of tools work? Starting in a random position and truncate space to resize? What is the possibility of losing data in my situation?

Why cannot I see, in a GUI tool, where are my data, how they distribute, and tell the reduction procedure to avoid them, or to reallocate them before resize? Is there something out there to satisfy my requirements?

EDIT:

I found that fstransform claims to be able to transform the filesystem without damaging data. Leave note here for further study. xfs is a pain..

2

You can't shrink a root partition which is in use mounted as read-writable, because it's constantly accessed from the live system. See this question for a (non-trivial) solution.

GParted is also available as Live-CD-Image; I recommend to use that (or an USB drive).

  • Certainly something worth trying. I will dig a little and report back – WesternGun Dec 28 '17 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.