What does ‘mount point’ mean in a Linux installer

backuphomemountsystem-installation

While installing Linux, it asks for a 'mount point' selection. I gave it /, but I don't know the exact meaning and aim of this.

Also, now I want to create one more mount point, /home in my machine with the already installed Linux with mount point /. Is it possible to do that from my current Linux install? If yes, what are the steps/commands?

My understanding of 'mount point' is, when I need to preserve my /home contents in a safer way that it won't get deleted if my current Linux get corrupted. For example, by detaching and connecting the hard disk from the machine with corrupted Linux to a new Linux machine, I should get my /home content.

Best Answer

The mount point specifies at which location in the directory hierarchy a device or disk partition appears.

If you want to move /home to a new partition, you have to create a new partition for it, say /dev/sda4 and format it, e.g. with ext4. Creating partitions and formatting them can be comfortably done using e.g. gparted.

Then you have to copy the old contents to the new partition and modify /etc/fstab so /home points to the new partition. As root do something like this after having the partition created and formatted. Again, I assume /dev/sda4 for the partition, this is just an example and you have to use your real partition device:

$ mkdir /mnt/tmphome
$ mount /dev/sda4 /mnt/tmphome
$ cd /home/
$ find . -depth -print0 | cpio --null --sparse -pvd /mnt/tmphome/
$ umount /mnt/newhome
$ mv /home /old_home
$ mkdir /home
$ mount /dev/sda4 /home

Now check if your system is still working correctly. If it does, add a line like this to /etc/fstab:

/dev/sda4 /home ext4    defaults        1 2

and delete the backup in /old_home

if however you find that something went wrong, you can move back by not adding respectively removing the above line in /etc/fstab and doing as root

$ umount /home
$ rmdir /home
$ mv /old_home /home

This answer is inspired by the howto on http://embraceubuntu.com/2006/01/29/move-home-to-its-own-partition/

Related Question