You are not logged in.

#1 2018-03-19 02:29:16

roachsinai
Member
Registered: 2016-10-23
Posts: 11

Mount an existing system to /home, didn't remove the old /home!!!

My / dir space was not enough, so I create a new partition for dir /home. I mount this new partition to /home follow this archwiki: Add new partitions to an existing system .

But I'm not sure if I should do the remove operation blow:

When you are certain the information was written correctly to the new partitions delete the information from the old directories.

# rm -r /olddir

After I reboot my laptop, I found the mistake that I didn't free the disk space cause I didn't remove the old /home!!

So what can I do to free the useless space?

dev             3.9G     0  3.9G    0% /dev
run             3.9G  1.2M  3.9G    1% /run
/dev/sda9        31G   29G  312M   99% /
tmpfs           3.9G   16M  3.9G    1% /dev/shm
tmpfs           3.9G     0  3.9G    0% /sys/fs/cgroup
tmpfs           3.9G   44M  3.9G    2% /tmp
/dev/sda7       477M   50M  398M   12% /boot
/dev/sda10       77G   16G   57G   22% /home
/dev/sda2        95M   25M   71M   26% /boot/efi
tmpfs           788M   16K  788M    1% /run/user/1000

Offline

#2 2018-03-19 02:31:54

roachsinai
Member
Registered: 2016-10-23
Posts: 11

Re: Mount an existing system to /home, didn't remove the old /home!!!

sad sad sad What a mistake!!

Offline

#3 2018-03-19 02:37:06

loqs
Member
Registered: 2014-03-06
Posts: 18,960

Re: Mount an existing system to /home, didn't remove the old /home!!!

temporarily mount /dev/sda9 to /mnt so you can remove the contents of /mnt/home or boot to rescue.target login as root unmount /home then remove the contents of /home.
Note you want to leave the directory home itself so it can still be used as a mount point.
Edit:
You have already copied the data across I assume.

Last edited by loqs (2018-03-19 02:38:23)

Offline

#4 2018-03-19 02:38:40

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,652

Re: Mount an existing system to /home, didn't remove the old /home!!!

When you mount a volume on a mount point ( /home ) that volume masks everything in the /home directory on the original volume.  So, when you mount the volume on home, you see all the files in that volume in /home; but the files in /home of the original volume are still there -- you just cannot see them as long as something remains mounted there.

If you are SURE the files on the original volume are safely backed up and/or moved to the new volume that is being mounted on /home, then you can remove those files.  Umount /home; you should be able to see the files that are using up your space in the directory /home -- they are now visible as /home is not being used as a mount point.  Delete those files. Remount the volume on /home.


If what I have said does not make sense, you don't understand it, or my assumptions are wrong -- stop!  Ask more questions.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2018-03-19 02:46:31

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: Mount an existing system to /home, didn't remove the old /home!!!

No need to umount /home. You can mount things twice, no problem.

mkdir /mnt/root
mount --bind / /mnt/root
cd /mnt/root # this is the root partition without submounts
ncdu /mnt/root # check what is taking the most space

Offline

#6 2018-03-19 03:01:10

roachsinai
Member
Registered: 2016-10-23
Posts: 11

Re: Mount an existing system to /home, didn't remove the old /home!!!

Thanks a lot, @loqs @ewaller @frostschutz !!!

And @frostschutz 's method works well!

Offline

Board footer

Powered by FluxBB