How do I set a RAID array as a /home mount point on Linux?

7,715

To move your /home partition (which is a risky thing to do), you will need to -

First, format your new partition -

mkfs.ext4 /dev/md0

Then, add "/dev/md0" to your "/etc/fstab". Something like -

/dev/md0     /home     ext4     defaults     0     0

Then (the "p" is for preserve permissions)

tar cfp /home.tar /home

Next,

rm -rf /home && mkdir /home && mount /home

Finally,

tar xvvf /home.tar

Of course, if it doesn't work you will need to reinstall your system.

Share:
7,715

Related videos on Youtube

Kasama
Author by

Kasama

Updated on September 18, 2022

Comments

  • Kasama
    Kasama over 1 year

    I need to create a file server using Ubuntu Server 13.10 with the following specifications:

    • 1 80Gb HDD:
      • grub boot manager
      • System files
      • apache server files
    • 2 identical 1000GB HDDs:
      • RAID 1 array for redundancy (/dev/md0)
      • files that will be accessible via FTP
      • home folders for all users on the system with those said files

    Here's the issue I'm having:

    While installing Ubuntu Server 13.10, I forgot to set the RAID array (/dev/md0) to be mounted as the home folder. I finished configuring everything about the FTP server, apache, ssh and other services.

    Now I noticed that the RAID Array was not being used at all,

    Every solution I look at says to essentially reinstall everything, and start over. I'd rather not do that.

    How do I set /dev/md0 to be mounted as a home partition without reinstalling the system?

    • Kasama
      Kasama about 10 years
      @ElliottFrisch would you mind to be a bit more precise about how to add the /dev/md0 to my fstab saying that it should be mounted as /home. Is it '/dev/md0 /home ext4 defaults 0 0' ? or something else?
    • Elliott Frisch
      Elliott Frisch about 10 years
      I have to go fight Atlanta traffic, don't expect a quick answer. However, that looks right.
    • Justin
      Justin about 10 years
      @Kasama Please don't put solved in the title. You indicate your problem has been solved by upvoting an answer or marking it as 'accepted' (the checkbox underneath the voting box for each answer).