Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 473  / 2 Years ago, tue, october 11, 2022, 11:21:24

I support a laptop running Ubuntu in another state (so I don't have physical access to it). It is an EeePC with two internal drives: a 4GB flash drive with the root fs, and a larger (~12GB) drive with the /home partition on it (and plenty of free space). The user tried to upgrade to 11.10, and the upgrade failed because the root partition doesn't have enough free space to perform the upgrade.



I remember running into a similar problem on a laptop once before, which just had one physical drive but a poorly-thought-out partition scheme; I think I just symlinked a directory from a too-small rootfs partition to a larger partition. In this case, I think the best solution is to bind-mount whatever directory Ubuntu wants to use to store its downloaded files to the larger drive.




  • What directory (or directories) is the important one that needs to be 'moved' to the larger drive?


  • If I can get away with just bind-mounting one directory, do I just need to do it once, at the beginning of the installation, or do I need to add the bind-mount to the fstab (i.e. because the files are still needed after reboot, so the bind-mount needs to be persistent)?


  • Is there an easier or better way to accomplish the upgrade? (Neither a fresh install nor a repartition is an option right now)



More From » upgrade

 Answers
1

Over half the small hard drive was in /usr, so I just moved /usr to (the unecrypted) /home partition, and bind-mounted /home/usr to /usr, like this:



sudo su -
mv /usr /home/
mkdir /usr
mount --bind /home/usr /usr
echo "/home/usr /usr bind defaults,bind 0 0" >> /etc/fstab


sudo is in /usr/bin, so it's best to login as root first, so you're not stuck without a root session if things go wrong (/home/usr was owned by root with 700 permissions during the mv operation). mount, ls, and mkdir are all in /bin.



Be sure to have a backup plan ready if you try this: I can't count the number of things that could go wrong. Also, if I was going to do it again, I'd probably try to copy /usr into /home first (probably using something like rsync, cpio, or tar to preserve file attributes?) and test the bind-mounting before deleting the original /usr. But this time I got lucky and everything worked out.


[#42762] Wednesday, October 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zombieptu

Total Points: 490
Total Questions: 121
Total Answers: 108

Location: Nepal
Member since Mon, Jan 4, 2021
3 Years ago
zombieptu questions
Sat, Feb 18, 23, 20:00, 1 Year ago
Sun, Feb 27, 22, 02:41, 2 Years ago
Sat, Oct 30, 21, 00:00, 3 Years ago
;