On 2017-04-08 02:43, Marc Chamberlin wrote:
On 04/07/2017 03:45 PM, Carlos E. R. wrote:
On 2017-04-07 22:03, Marc Chamberlin wrote:
Well this is one of those times I wish software designers would have followed the KISS principal, and design the Linux system in a way that is easily understandable, sigh... A recent set of updates broke, on one of my OpenSuSE Leap 42.2 x64 servers because of lack of disk space in the partition for the root partition for /. My investigations showed that the contents of /usr was taking up the lion's share of space (8GB) of the partition on which / is mounted, which only had 10GB of total space allocated to it. My /usr contains 32 GB of files. Wow! I will make a big partition for future growth!
Mine is a bit extreme :-) And it is not in a single partition, but three. One of them YaST said was too small today during an update.
Once the change is activated (fstab), you need to run mkinitrd to change the boot ramdisk.
Thanks Carlos for your guidance, just to be clear, (the devil is in the details as always...) the steps I think you are saying that I need to follow is - ?
1. Use Yast2 Partitioner to create a new partition and mount it as /usr_new
2. su root
3. cd /usr
4. cp -a * /usr_new
This step I do with "mc". I'm lazy to remember all the proper switches. You have to ensure that hard/soft links stay. Also that sparse files remain sparse. The proper tool is rsync, but having a good look at the options. I use: OPTIONS="--archive --acls --xattrs --hard-links --stats --human-readable "
5. Edit fstab so as to change the mount my new partition from /usr_new to /usr
now I am a bit unsure, I think I want to rename /usr to something else so that later I can delete it and recover the space, but the moment I do, I break a whole lot of the system!
6. mv /usr /usr_tmp
You say I need to activate the new fstab but at this point I would not be able to execute a mount command!
Good point. I forgot that. You can try see what happens, perhaps. Try call "/usr_tmp/bin/mount", perhaps it works.
Or do much else for that matter. So should I perhaps just mount the new partition instead, on top of /usr and not rename it? What happens to the contents of my old /usr if I now do a mount -a and how would I eventually recover the space it occupies?
6. mount /usr
Yes, you can certainly mount usr partition on top of /usr, yes. Nothing happens to it, simply it becomes not accessible.
Assuming I can get past step 6 somehow, which seems like a Catch22, and got /usr back, I think you are saying my next steps are -
7. mkinitrd
If new partition is mounted on top of /usr, we need an extra step here. Halt computer, boot rescue system, rename /usr to /old_usr, create empty /usr.
8. reboot
9. Pray all goes well....
10. If all goes well and system boots up successfully and I have /usr_tmp then
11. su root
12. rm -rf /usr_tmp
Easy Piezzy eh? ;-) Well only if I can grok what step 6 should be... Marc...
Last time I did this was over a year or two ago. Another possibility of doing it all, is booting a rescue system, doing the partition-copy-move-fstab-edit thing, then chroot it all to run mkinitrd. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)