Need to resize my lv_root, any tips?

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.

Do you mean the partition the LVM volumes live on?

That is correct. Under SDA I have SDA1 which is where all the grub stuff resides and SDA2 where I have the lv_root and lv_swap volumes. That SDA2 partition is 99G.

@tessierp: DANGER ZONE

Normally I would make sure I know the start and end sector of the partition fdisk -l /dev/sda and write those numbers to a file fdisk -l /dev/sda > partitions or even make a backup of the hole MBR booted from a recovery USB dd if=/dev/sdX of=backup-sdX.mbr bs=512 count=1

Then delete with the partition in fdisk and recreate it with the exact same type, start sector and the minimal size plus headroom to be save (ie total +42G in your case)

Do not know if a Linux LVM partition survives this…

(Hence with all the benefits XFS may have, I hate it)

I would say it probably doesn’t survive since it needs to be attached to a drive…

I totally agree there, I never had so much trouble before with a filesystem. I really do not like XFS and I hope the next version of Nethserver gives us an option to install another FS. Or is it possible and I just didn’t pay attention? :thinking:

It is CentOS, so Nethsever, default. For nethsever-installs I keep the default.

If I install a CentOS VM for development (which are throw-away VM’s) tend to partition manually with good old ext4; simply because resizing is easy. :astonished: