My office system's HDD capacity was 500 GB, but the usable space was only around 100 GB. When I analysed disk I found that some of the space was used by boot
and swap
and the rest was used by an empty folder named NewFolder
under the root directory. This folder was found to contain around 350 GB and was unusable(no read/write permission) for the user.
When I investigated more, It was found that the ownership of that folder was neither root nor user (May be system admins did it by mistake during installation). So I changed the ownership to my user. And now I am able to access the entire space.
My question is, is it possible for me to mount this partition to my home
directory? If possible how? If not possible, why?
Edit
Output of df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 92G 84G 3.8G 96% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 3.9G 12K 3.9G 1% /dev
tmpfs 786M 1.4M 785M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 17M 3.9G 1% /run/shm
none 100M 76K 100M 1% /run/user
/dev/sda6 922M 292M 567M 35% /boot
/dev/sda7 359G 67M 341G 1% /NewFolder
output of cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=aede36a3-fb06-4fe0-969d-011f063ba568 / ext4 errors=remount-ro 0 1
# /NewFolder was on /dev/sda7 during installation
UUID=efd23971-f61a-41f3-bd28-bbdf76c74673 /NewFolder ext4 defaults 0 2
# /boot was on /dev/sda6 during installation
UUID=d93f32a4-f5a2-4f3c-a243-6d20bad200ce /boot ext4 defaults 0 2
# swap was on /dev/sda1 during installation
UUID=4ee0e7f2-03fa-489a-93bc-4152c69a1c26 none swap sw 0 0
Sure, it's possible
Replace
<your_user_name>
with your user name andNewFolder
with a name of your choice.Create a new mount point, eg:
and mount
If it works then change the entry in your
fstab
:from this
to this
You can check the UUID with this command
Sample output:
The home folder is supposed to hold your user folder. When you mount a partition to
/Home
the first thing that is created on that partition is the user's directory. You can mount any partition to/home
and use.If you value the data in that folder You could create a soft Link to that folder to any new folder under your
/home
and call it whatever you like.So if you did this:
This will create a symbolic Link to
/NewFolder
under/home
and if you click on/home/NewFolder
it will open the/NewFolder
for you.Here's how I'd do it:
First - I'd create a new filesystem on your partition:
Start by unmountig your partiton:
sudo umount /dev/sda7
Then, create the new filesystem:
sudo mkfs.ext4 /dev/sda7
WARNING: this will erase all contents of/dev/sda7
partition.Then, I'd temporarily mount it somewhere;
sudo mount /dev/sda7 /mnt
Then, I'd copy the contents of my home dir into the new partition:
sudo rsync -avP /home/ /mnt/
(using rsync will maintain permissions)Unmount the partition:
sudo umount /dev/sda7
edit
/etc/fstab
to mount your new partition on/home
by changing the line:UUID=efd23971-f61a-41f3-bd28-bbdf76c74673 /NewFolder ext4 defaults 0 2
to:
UUID=efd23971-f61a-41f3-bd28-bbdf76c74673 /home ext4 defaults 0 2
If you wish, you may now erase the contents of your old 'home'
sudo rm -rf /home/*
WARNING: This is a destructive command, make sure your data is safe in the new partiton before you issue it!Reboot and you are done.
You can mount the 359GB partition in
/home
instead of/NewFolder
sudo mv /mountpoint/to/dev/sda5/home/* /mountpoint/to/dev/sda7
/etc/fstab
/NewFolder
, replace/NewFolder
by/home
Original line:
Edited line:
Note: This will store the home folder of all the users (except root) on the 359GB volume.