Advice needed on fresh install using existing md0 disk

Hi all,

Currently I run F30 and have been using md to mirror two identical disks as a personal raid solution and a form of crude backup. However, I want to change my setup where I mount my /dev/md0 directly to \home. Currently my setup looks like this (I have left out non essential info like tmp directories):

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/fedora-root      163G   32G  123G  21% /
/dev/sdc2                    976M  188M  722M  21% /boot
/dev/sdc1                    200M  8.1M  192M   5% /boot/efi
/dev/mapper/fedora-home       50G   63M   47G   1% /home
/dev/md0                     916G  262G  608G  31% /home/data

Now my worry is, that if I do an upgrade, I will still have my md0 as an independent directory under /home/data, while I want the /dev/md0 to be mounted on the /home in stead of /dev/mapper/fedora-home.

If I do a fresh install, I will lose my configuration of /dev/md0 and not sure how to reconfigure md0 without losing my data (which is currently mirrored).

Can anyone point me in the right direction to get my /dev/md0 mounted on /home without losing my data and my configuration?

Or, alternatively, even have /dev/md0 mounted on home in my current setup, i.e. before I do the upgrade?

Kind regards, Guus.

What do you want to do with the existing data in /home?

I created a link from my home dir /home/gbonnema to the md0 disks. The current home directory i.e. /dev/mapper/fedora-home I can overwrite.

You created a link from /home/gbonnema to /home/data/gbonnema or /home/data?

Yes, I did create the /home/data/gbonnema link.

Then it should be straightforward, you’ll need to edit the filesystem table to point to the new one. If you post the output of cat /etc/fstab, I can walk you through it.

This is the contents of my /etc/fstab:

UUID=ac31bd35-96fa-4ff4-96cd-fd69556d0563 /boot ext4    defaults        1 2
UUID=AE09-4AC8          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
/dev/mapper/fedora-home /home                   ext4    defaults        1 2
/dev/md0				/home/data				ext4	defaults		1 2
/dev/mapper/fedora-swap swap                    swap    defaults        0 0
\\madrid\D				/ddisk-madrid			cifs	uid=1000,gid=1000,vers=2.0,noauto,cred=/home/gbonnema/cifs-cert 0 0
# replaced nasser by 192.168.1.100 due to early refusal to recognize nasser at startup
192.168.1.100:/volume1/data	/data					nfs		defaults,ro		0 0
192.168.1.100:/volume1/data	/data-all/data			nfs		defaults		0 0

You’ll need to delete this line:

/dev/md0 /home/data ext4 defaults 1 2

and change this line:

/dev/mapper/fedora-home /home ext4 defaults 1 2

to:

/dev/md0 /home ext4 defaults 1 2

After a reboot, it should be switched. If it doesn’t work, you can boot from a Live CD/USB and switch the /etc/fstab file back to how it was.

2 Likes

Thank you. That was the push I needed. I suspect I can also mount /dev/md0 to /home while, remounting the /dev/mapper/fedora-home to some other partition in order to see if I missed something essential. Also, I could clean the fedora-home partition or maybe even remove it?

The one point I worry about is, if I delete a line from fstab, will the system shutdown properly? The same for /dev/md0. Should I log on as root on a console, umount /home and remount it from /dev/md0? Or would that complicate matters even more?

You can do it at runtime; that’s just a list of things to mount at startup. Actually mounted things are stored in the kernel, and can be viewed in /proc/mounts or using mount -l. Remounting it is probably more complication than it’s worth rather than just rebooting.

Since you seem to be using LVM, once everything is working, you should be able to delete the partition after, and extend the volume for the new one to contain the old space.

3 Likes

I marked the answer with instructions you gave as the solution. Thank you for your time and effort.

When executing this procedure it worked as described. However, be altert that some programs register the absolute path to their files. In my case the ~/.thunderbird/profile.ini was pointing to the old directory /home/data/gbonnema which no longer exists. So when I started the thunderbird program it could no longer find its profile and quit with an error message. Editing the profile.ini file solved the issue and I could normally start thunderbird.

I mention this for anyone wanting to do this procedure. Other programs may register the absolute path as well.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.