Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Today I tried this on my machine with OpenSUSE 12.3 (kernel 3.7):

# resize2fs /dev/mapper/system-srv 2G
resize2fs 1.42.6 (21-Sep-2012)
Filesystem at /dev/mapper/system-srv is mounted on /srv; on-line resizing required
resize2fs: On-line shrinking not supported

/dev/mapper/system-srv is an EXT4 volume.

Is it really unsupported or I am missing something?

share|improve this question
up vote 30 down vote accepted

As the message said, you can only grow a filesystem on-line. If you want to shrink it, you will need to unmount it first.

According to the ext4 filesystem maintainer, Ted Ts'o:

Sorry, on-line shrinking is not supported.

share|improve this answer
5  
That's a pity... – ntrrgc Aug 1 '13 at 19:06
2  
What's with the downvote? – Michael Hampton Sep 23 '14 at 17:43
3  
@MichaelHampton - some moron shooting the messenger? :D – tink Sep 29 '15 at 22:49

Yes, you can shrink/move/grow an online root partition without any reboots (nor livecd, nor usbkey): consult this answer. It's very well written and easy to follow, although quite long and a little risky.

This allows to bypass limitation of resize2fs not being able to shrink online ext4 partitions.

Of course, if you only want to grow your ext4 partition, you can stick to the conventional working resize2fs solutions.

The general solution I've linked will work on any type of dedicated or VPS solution for instance.

TLDR; this solution implies to pivot_root to tmpfs so you can umount safely your root partition live and fiddle with it. Once done, you'll pivot_root back on your new root partition.

This allows pretty much any manipulation on the root file system (move it, change filesystem, changing it's physical device...).

I have personally used this, and it works very well on debian system also, but the guide was initially written in 2007 for redhat, the answer I've linked was updated for CentOS7. It's highly probable that it'll work on your OpenSUSE, although probably with some adaptation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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