Need to resize my lv_root, any tips?


Any recommendations on how to redize lv_root? I originally assigned a lot of disk space but use only 5%. Any tips on how I can resize (shrink) my disk?




AFAIK the only real option is backup / restore to a smaller VM…
XFS doesn’t support shrinking.

My 2 cents

I was afraid someone was going to tell me that… Not looking forward to have to restore Zabbix, doku, etc… XFS can’t be resized, that is a big limitation.



Not true, XFS can easily and quickly be resized - it only takes about 30 seconds to resize XFS to any size. But not schrinking!
That’s why I always emphasize: choose a small disk for starters, it’s so quick to allocate more space. But overdo your space, you waste a lot of time with backups / restore.

On real hardware no one starts with too big disks. You may upgrade the disks in 2 years, for example. But data does not schrink in real life… Only on virtual hardware do people oversize their disks and want to schrink a disk!

My 2 cents

I don’t agree with you on that one. You can size one way but not the other way. There are many situations where I can think and especially happened in my professional life where we had to downsize a partition and was a perfectly valid reason. Most FS, actually all FS I’ve used allow this.

Anyways, XFS doesn’t, lesson learned.

At this point, I’m just going to wait for Nethserver 8.0 and take care of porting things over then.

Windows also only could downsize since Win10, before that (Win7, XP) you needed commercial, third party tools to downsize a partition.
You could always use fdisk to format and recreate a partition, yes.

But in 35 years I’ve not seen one case of hardware disks “downgraded”, neither pc nor server!

If a disk was “overpartitioned”, yes, repartitioned. But NEVER a smaller disk built in!

My 2 cents

Yep, and we had it when we needed it, in the industry… Like I Said, it happens and in more than one occasion.

Yep, I’ve read on a procedure like that but not sure how well that will work and how tedious it will be.

Well I guess we both have been in different industries and maintain my point that this happened and we had to reconfigure for clients and there was no way in hell we were going to redo the setup from scratches. Not all sizes fits all :wink:

I still won’t believe you if you said there was a valid reason for putting in a smaller disk in a machine - and even less if you say it happened! :slight_smile:

What you’re talking about is repartitioning systems that are generally and often multi partition systems. DOS / Windows was multipartition since the earliest days…

But I’ve NEVER seen single partition systems changed. Linux often does a separate partition like /home, but not SME, nor NethServer.
Also, I’ve never seen anyone want to shrink a partition on a PFsense or OPNsense. A larger disk, eg to accomodate Proxy, sure! But not resizing a partition!

Why would you want to, the pre-sizing of both OPNsense and PFsense make sense as they are!

But bad planning exists, that’s also true. Even, and especially in large Enterprises! Waste goes so easily unnoticed in large organisations…

And: We’re talking about “servers” here, not workstations or gaming machines in a private household!

My 2 cents

That is your right if you want to justify your scenario to only be the valid one but it happened more than once :wink: There is a reason why these tools exist on all platforms! Windows, Linux, Macintosh. If everyone in 35 years never needed that, they would not exist. Not all sizes fits all.

And I would not attribute that to bad planning but to, priorities changed. And just like you may start small and increase, perhaps you will want to shift an installation from one server to another requiring to shrink it. And that is why this happens even with bare metal. Again, if there was no need for them, they wouldn’t exist, yet they do :slight_smile: …

Anyways, this is pointless arguing, I only wrote to see if there was a way to fix my issue, there isn’t that is simple, too bad :slight_smile: I’m about finding solutions in a productive manner, I just don’t see how you telling me you don’t believe me just to hold on to your point helps. But it is your right :slight_smile:

Anyways thanks for the help

That ALWAYS entailed a Backup / Restore !!!

That is the longer route… Big no no in the private industry if you can avoid it. Much better if you can resize… Even better, you resize and then save on cost by putting the smaller size on a smaller hard drive. A lot less pain than having to restart from configuration, reinstall from backups, etc.

And backups are ALWAYS done. But here, my need is to avoid going through the long 9 yards by just resizing. Anyways.

Well, we DID talk about disk size before you installed that server…

Again, my needs changed… We are going in circles. :wink: Solutions please…

If it’s small, a backup / restore on a fresh VM is not that painful…

There is a lot of effort into configuring Zabbix and Doku, if I can avoid it, I will…

Backup / Restore there should be no need to reconfigure Zabbix or DokuWiki…

There’s also clonezilla…

1 Like

Yeah I may give that a try (Clonezilla)…

1 Like

After you did made backups (and a disk-clone)

Maybe this helps:

1 Like

Hi Mark

I tried that last night. It worked, partially. The procedure to resize a XFS volumes works great, I now have a 31G lv_root with 9G lv_swap for a total of 40G for that LVM. I was able to boot Nethserver without any issue.

The problem I have now is my disk is still 100G and I haven’t found anything that would allow me to resize the disk itself. GPARTED sees that I have 60G unused but somehow will not allow me to resize.

I also tried Clonezilla which is unable to clone from one disk to another.