How to mount a partition on the root directory (for example /data)

20,852

I don't know what should prevent you from mounting that partition just under root. The command would be sudo mount /dev/sda1 /data, where /dev/sda1 is the partition. Unmount via sudo umount /data.

To mount on startup add the following line to /etc/fstab:

/dev/sda1    /data    <partition type>    defaults    0    0
Share:
20,852

Related videos on Youtube

dac
Author by

dac

Updated on September 18, 2022

Comments

  • dac
    dac over 1 year

    I am installing Ubuntu on my empty hard drive and I would like to have a separate partition on which I would store my data, like movies, music, documents, etc.

    I don't like the idea of putting those files in /home/user directory because I would have multiple users on my computer and I want them all to easily access those files. I might also have multiple operating systems on my computer.

    Now, the idea is, I would like that partition to be mounted on something like /data , instead of /media/data.

    Is that safe, and how can I do that?

  • SaintWacko
    SaintWacko over 11 years
    @dac - Take a look at this. Edit: Oh... er... Just saw that alnkpa already answered that...