0

I upgraded my OpenSuse Linux to 15.3 and the "/" root had a little too few diskspace left, so i decided to move /usr to a new device. I copied all files from /usr to the new device, edited the /etc/fstab to update that in the fstab and bootet.

Then, the system used the new device for /usr

/dev/sda3 .... .... 22% /usr

All went without difficulty. With one minor shortage: Root / had the same fill level as before. (Because the "old" /usr was still under the device (mounting of the new /usr was disguising the old /usr only). So i booted into single user mode to get rid of the old /usr, and while several processes also are working in single user mode on /usr (which i didnt aspect) i umounted it with

ummount -l /usr (lazy)
Moved it to prepare it for later deletion (mv /usr /xusr)

So the entry in /etc/fstab would mount the /usr on /dev/sda3 so i were able to delete /xusr

But after a reboot nothing worked anymore and Linux threw me to a rescue mode with only some commands left (the most important), i could do nothing, there were no fstab anymore, no root, no device, i think it was only the raw kernel.

After some though about my miserable situation and trying, i mounted several devices to /mnt (mount was working) and found finally the original root device and moved xusr back to is old name /usr so kernel could find it at boot time.

My question: How could someone move /usr to a new location? (I found out, that could be impossible because all important system commands would be in that area and kernel would mount /usr in first place, before it could handle the fstab?)

Is it possible?

1 Answer 1

2

First, a big warning: many modern distributions, including OpenSuSE, are now migrating to a "merged /usr" layout, where you can no longer make /usr a separate filesystem: if you attempt to do so, you will fail exactly in the way you experienced.

Basically, the distributions will be building all packages to install into /usr/bin and /usr/sbin, and the old /bin and /sbin will eventually become just symbolic links to /usr/bin and /usr/sbin respectively. Same for /lib, eventually.

Since you're using OpenSuSE 15.3 which was released... yesterday(!), it is definitely newer than OpenSuse's UsrMerge announcement linked above, and that probably means your plan of splitting off /usr is not going to work at all.

(I would have added a link to the appropriate part of OpenSuSE 15.3's list of new features, but OpenSuSE's servers seem to be very busy right now: I cannot seem to get those pages opened.)


What filesystem type are you using on your root filesystem? SuSE has been a pioneer on the use of the BtrFS filesystem, and if you are using that, then there will definitely be ways to extend the filesystem to other partitions or even to other disks, on-line and without rebooting.

Basically, if /dev/sda3 is now an unmounted partition that can safely be overwritten, and your / is using BtrFS, you could do these two commands:

btrfs device add /dev/sda3 /
btrfs filesystem balance /

And you should now have about sda3's worth of extra capacity in the root filesystem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .