-
Resize the RAID1 root partition without rebooting
Posted on February 26th, 2023 No commentsResizing the root partition on a server 12 miles away seemed a bit risky. The root partition is on a software RAID1 mirror, no LVM. Twelve years ago I left only 2 GB for the root partition. I wanted to upgrade to Ubuntu 20.04.5 and the small size quickly became a problem. I managed to upgrade to Ubuntu 18.04.6 LTS, but ran out of space while upgrading to 20.04.5 LTS. Even after uninstalling previous versions, there was not enough space left. I had to make the root partition bigger. There was a relatively large 8 GB swap partition right after the root partition. The RAM is only 2 GB, so I was able to reduce the size of the swap. The plan was to delete the swap and extend the root partition, then create a smaller swapfile. I’ll show you how I did it. The server did not have to be restarted even once during the partition conversion. Finally, I have 5 GB free space after upgrading to Ubuntu 20.04.5 LTS.