SUSE Conversations

Just a bit too much… resize your root volume

By: jweewer

January 20, 2011 10:47 am





A few weeks ago my laptop was starting to produce strange errors on my old OpenSUSE 11.0, mainly due to me and my big curiosity for new things, compiles of applications etc. etc. So it was time to reinstall my work laptop with a complete new fresh OpenSUSE 11.3 installation.

One of the first things that came to my mind was, how am I going to setup my partition scheme. Then my second thought was let’s do it completely with LVM, except for the /boot this will be a little fixed partition of 150MB and my swap partition. So I created a few logical volumes, and one of them was my root volume /, I made this 60GB. Don’t ask me why I did this but it seemed okay at the time.

A few weeks later I was resizing some volumes to create some space for my virtual machines, and offcourse then you need to unmount the partition you want to resize. This can be done using for example using the nice yast partition tool or just the console commandline option. So my thought was why did I made this volume this big I’m only using about 5GB max of it, so let’s resize it back to 10GB to be safe. Unfortunately the resizing does not work for your root volume because you can’t unmount this while your system is still running. Luckily I had my CD case with me and I found had my SLES11 DVD, so I booted my laptop with this DVD in rescue mode. This is where the fun starts.

Little side note, my volumegroup is called system and my root volume is called root, i like it simple. And it contained an ext4 filesystem.

Make sure you have the prompt in front of you.

# lvm vgchange –a y

This next step may take a while before it is complete

# resize2fs –f /dev/system/root 10G
# lvreduce –L10G /dev/system/root

Now this root volume was brought back to 10GB. Only thing left was to reboot my laptop without the DVD and start smiling. I got some more GB’s to use on my laptop for my precious virtual machines.

So if you ever do such an action like me and you realize: i made my root volume too big. Now you know how to resize it.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Categories: openSUSE, SUSE Linux Enterprise Desktop, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.