[SOLVED] How do I change the name of a mounted array?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

[SOLVED] How do I change the name of a mounted array?

Post by gene0915 »

I just noticed something silly. A long time ago, I created my primary RAID array (defaulted to md0 for the name) and then I created a secondary array... to back the first one up to. My backup array somehow got the following name: bacup

Here is the pertinent line from MDADM.conf

Code: Select all

ARRAY /dev/md/bacup  metadata=1.2 UUID=616e8892:40d17945:ebd2fb3b:914293d8 name=server-pc:bacup
... and from fstab.conf

Code: Select all

/dev/md127 /mnt/backup ext4 defaults,nofail,discard 0 0
To correct my mistake, is it as simple as just changing the name from bacup to 'bacKup' in the mdadm.conf file and rebooting or do I need to do that AND something else? (as in, some grub/initrd/initramfs voodoo?!)

Yes, I could probably just try this out and reboot and see what happens but I still consider myself a newbie and I'm terrified of wrecking my backup array so just need some re-assurance.

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How do I change the name of a mounted array?

Post by catweazel »

gene0915 wrote: Tue Aug 14, 2018 8:12 pm To correct my mistake, is it as simple as just changing the name from bacup to 'bacKup' in the mdadm.conf file and rebooting or do
No.

https://askubuntu.com/questions/63980/h ... raid-array
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

Re: How do I change the name of a mounted array?

Post by gene0915 »

catweazel wrote: Wed Aug 15, 2018 2:33 am
gene0915 wrote: Tue Aug 14, 2018 8:12 pm To correct my mistake, is it as simple as just changing the name from bacup to 'bacKup' in the mdadm.conf file and rebooting or do
No.

https://askubuntu.com/questions/63980/h ... raid-array
That link did the trick, thanks! Only problem I ran into was, I forgot I needed to unmount the array first. :)

For future travelers, here were the commands I carried out to correct my mdadm array:

Code: Select all

sudo umount /mnt/backup
sudo mdadm --stop /dev/md127
sudo mdadm --assemble /dev/md/backup --name=backup --update=name /dev/sdg /dev/sdl /dev/sdb /dev/sda (your drive letters will differ from mine!)
sudo mdadm -Db /dev/md/backup (paste the output from this command into your mdadm.conf file)
sudo update-initramfs -u
Reboot and done. md127 is now properly labeled as 'backup'
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How do I change the name of a mounted array?

Post by catweazel »

gene0915 wrote: Wed Aug 15, 2018 12:17 pm That link did the trick, thanks!
You're most welcome.

Cheers.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Beginner Questions”