Moving /home to a new bigger MD array

Fien

Well-Known Member
OP
Member
Joined
Sep 27, 2021
Messages
222
Trophies
0
XP
1,299
Country
Netherlands
I've a Linux PC running as fileserver. It has a software RAID1 array /dev/md0 mounted to /home which is then shared using NFS and Samba.

Now I want to move the /home from a 1TB array to a 2TB one.

- I created a new RAID1 from two 2TB drives at /dev/md1. I mounted it temporary to /media/md1.
- It's now using "rsync -a -v /home/ /media/md1/" to copy all the contents over to the new array.

The /etc/mdadm/mdadm.conf looks like this at the moment:
Code:
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
ARRAY /dev/md0 UUID=b14e84da:d006a11e:111cb762:714df31f
ARRAY /dev/md1 uuid=f64ba8cf:ce3238dd:230e0090:6fefa703

When the new array is synchronized and the data copy is completed, is it then as simple as removing the /dev/md0 line and modify the new one to "ARRAY /dev/md0 uuid=f64ba8cf:ce3238dd:230e0090:6fefa703", shutdown the server, remove the drives of the old 1TB array and boot it up so the new array will become /dev/md0?

The mounting line in /etc/fstab is
Code:
/dev/md0        /home           auto    defaults        0       0
so if the new array can become /dev/md0 it will work without more modifications?
 

KleinesSinchen

GBAtemp's Backup Reminder + Fearless Testing Sina
Member
GBAtemp Patron
Joined
Mar 28, 2018
Messages
4,434
Trophies
2
XP
14,888
Country
Germany
Sounds fine.
Just backup the configuration file and try.
Should not do any harm. System will boot even without /home if anything fails.
 

Fien

Well-Known Member
OP
Member
Joined
Sep 27, 2021
Messages
222
Trophies
0
XP
1,299
Country
Netherlands
I did this in the morning at the system failed to boot. It waited for the old md0 array and after some minutes I was dropped on the command line asking for the root password for maintenance. Or Ctrl+D to continue booting, but that was unsuccesful.

It seems like the array information is also stored in the initramfs. So I gave in the root password and ran "update-initramfs -u". After a reboot everything seems to be fine.
 
  • Like
Reactions: KleinesSinchen

KleinesSinchen

GBAtemp's Backup Reminder + Fearless Testing Sina
Member
GBAtemp Patron
Joined
Mar 28, 2018
Messages
4,434
Trophies
2
XP
14,888
Country
Germany
Glad you solved it and good to know. → :) Would not have expected that.

Although the same is needed when changing allowing/disallowing discard operation on LUKS encrypted system partitions in /etc/crypttab
So… I should have expected this.
 
  • Like
Reactions: Fien

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Yeah they gotta reproduce somehow