Mdadm: can I resize the partition of a mdam if I have only one primary partition per disk and RAID 1? In yast?
I have a mdam md0 with two hdd 4 TB. They are in use as /home I now have two HDD with 8TB. I normally work with mdam in CLI. I did up to now a planed degrading of the secondary disk of the md0. Then a hot remove. Then I added the first 8TB. with other words: silversurfer:~ # mdadm --manage --set-faulty /dev/md0 /dev/sde1 mdadm: set /dev/sde1 faulty in /dev/md0 silversurfer:~ # mdadm --manage /dev/md0 -r /dev/sde1 mdadm: hot removed /dev/sde1 from /dev/md0 You have new mail in /var/mail/root silversurfer:~ # mdadm --manage /dev/md0 -a /dev/sdg1 mdadm: added /dev/sdg1 It does now sync the data with the 4 TB (hence creating a 4TB on a 8TB disc. Rest of the disk is empty, no other partitions. I will then declare failed the first 4 TB disk, hence hot remove and add 8TB. (here md0 /dev/sdb1) This will again sync 4TB on 8TB disk. Now, one the sync is done, is it possible to expand (e.g. in yast partition manager) the 4TB to the max capacity of the disc, although it is a Raid? How would I proceed and if it is not possible, how would I manage to expand a RAID1? Current status: entropy@silversurfer:~> lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 232,9G 0 disk └─sda1 8:1 0 232,9G 0 part └─md127 9:127 0 232,9G 0 raid1 /usr/local /boot/grub2/x86_64-efi /srv /opt /var /root /boot/grub2/i386-pc /.snapshots / sdb 8:16 0 3,6T 0 disk └─sdb1 8:17 0 3,6T 0 part └─md0 9:0 0 3,6T 0 raid1 /home sdc 8:32 0 298,1G 0 disk ├─sdc1 8:33 0 1K 0 part └─sdc5 8:37 0 298,1G 0 part /boot/efi sdd 8:48 0 447,1G 0 disk ├─sdd1 8:49 0 232,9G 0 part │ └─md127 9:127 0 232,9G 0 raid1 /usr/local │ /boot/grub2/x86_64-efi │ /srv │ /opt │ /var │ /root │ /boot/grub2/i386-pc │ /.snapshots │ / ├─sdd2 8:50 0 100G 0 part /var/tmp ├─sdd3 8:51 0 50G 0 part /tmp └─sdd4 8:52 0 64,2G 0 part [SWAP] sde 8:64 0 3,6T 0 disk └─sde1 8:65 0 3,6T 0 part sdf 8:80 0 1,8T 0 disk └─sdf1 8:81 0 1,8T 0 part └─md126 9:126 0 1,8T 0 raid1 ├─md126p1 259:0 0 200G 0 part └─md126p2 259:1 0 1,6T 0 part /var/lib/libvirt sdg 8:96 0 7,3T 0 disk └─sdg1 8:97 0 7,3T 0 part └─md0 9:0 0 3,6T 0 raid1 /home sdh 8:112 0 7,3T 0 disk └─sdh1 8:113 0 1,8T 0 part └─md126 9:126 0 1,8T 0 raid1 ├─md126p1 259:0 0 200G 0 part └─md126p2 259:1 0 1,6T 0 part /var/lib/libvirt sdi 8:128 1 0B 0 disk sdj 8:144 1 0B 0 disk sdk 8:160 1 0B 0 disk sdl 8:176 1 0B 0 disk sr0 11:0 1 1024M 0 rom Thanks in advance
Now, one the sync is done, is it possible to expand (e.g. in yast partition manager) the 4TB to the max capacity of the disc, although it is a Raid? How would I proceed and if it is not possible, how would I manage to expand a RAID1?
I suppose something like mdadm --grow --size max /dev/md0 resize2fs /dev/md0 Do a backup first in any case. I would prefer to create a new array with the 8ΤΒ disks, rsync the data, unmount the old home array and mount the new but maybe the above commands will work. Haven't tested it, so be careful. Good luck.
On 2023-01-19 14:19, Stratos Zolotas wrote:
Now, one the sync is done, is it possible to expand (e.g. in yast partition manager) the 4TB to the max capacity of the disc, although it is a Raid? How would I proceed and if it is not possible, how would I manage to expand a RAID1?
I suppose something like
mdadm --grow --size max /dev/md0
resize2fs /dev/md0
Almost correct. I believe the "grow" command should read --size=max, and the proper syntax is "mdadm --grow <dev_name> --size=<size>"
On 2023-01-19 21:13, Stakanov wrote:
I have a mdam md0 with two hdd 4 TB. They are in use as /home I now have two HDD with 8TB.
I normally work with mdam in CLI. I did up to now a planed degrading of the secondary disk of the md0. Then a hot remove. Then I added the first 8TB.
with other words: silversurfer:~ # mdadm --manage --set-faulty /dev/md0 /dev/sde1 mdadm: set /dev/sde1 faulty in /dev/md0 silversurfer:~ # mdadm --manage /dev/md0 -r /dev/sde1 mdadm: hot removed /dev/sde1 from /dev/md0 You have new mail in /var/mail/root silversurfer:~ # mdadm --manage /dev/md0 -a /dev/sdg1 mdadm: added /dev/sdg1
I don't know much about this, but, assuming sdg1 is on the new 8TB disk, when you partition it you make it already take the whole disk, ie, the 8TB. Thus the raid will know that one of the members has 8TB. It is then the filesystem which you have to expand, not the raid. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
In data giovedì 19 gennaio 2023 23:56:35 CET, Carlos E. R. ha scritto:
On 2023-01-19 21:13, Stakanov wrote:
I have a mdam md0 with two hdd 4 TB. They are in use as /home I now have two HDD with 8TB.
I normally work with mdam in CLI. I did up to now a planed degrading of the secondary disk of the md0. Then a hot remove. Then I added the first 8TB.
with other words: silversurfer:~ # mdadm --manage --set-faulty /dev/md0 /dev/sde1 mdadm: set /dev/sde1 faulty in /dev/md0 silversurfer:~ # mdadm --manage /dev/md0 -r /dev/sde1 mdadm: hot removed /dev/sde1 from /dev/md0 You have new mail in /var/mail/root silversurfer:~ # mdadm --manage /dev/md0 -a /dev/sdg1 mdadm: added /dev/sdg1
I don't know much about this, but, assuming sdg1 is on the new 8TB disk, when you partition it you make it already take the whole disk, ie, the 8TB. Thus the raid will know that one of the members has 8TB. It is then the filesystem which you have to expand, not the raid.
-- Cheers / Saludos,
Carlos E. R. (from 15.4 x86_64 at Telcontar)
I tried to set up the raid with both disks at 8 TB. I did this with mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sdg1 /dev/sdh1 Will try to mount it and to simply copy cp -ax to the new disc the whole content. That should do I guess.
On 2023-01-19 16:56, Carlos E. R. wrote:
On 2023-01-19 21:13, Stakanov wrote:
I have a mdam md0 with two hdd 4 TB. They are in use as /home I now have two HDD with 8TB.
I normally work with mdam in CLI. I did up to now a planed degrading of the secondary disk of the md0. Then a hot remove. Then I added the first 8TB.
with other words: silversurfer:~ # mdadm --manage --set-faulty /dev/md0 /dev/sde1 mdadm: set /dev/sde1 faulty in /dev/md0 silversurfer:~ # mdadm --manage /dev/md0 -r /dev/sde1 mdadm: hot removed /dev/sde1 from /dev/md0 You have new mail in /var/mail/root silversurfer:~ # mdadm --manage /dev/md0 -a /dev/sdg1 mdadm: added /dev/sdg1
I don't know much about this, but, assuming sdg1 is on the new 8TB disk, when you partition it you make it already take the whole disk, ie, the 8TB. Thus the raid will know that one of the members has 8TB. It is then the filesystem which you have to expand, not the raid.
You're right, you don't know much about this. If he doesn't grow the array to 8TB, all he will have is 4TB on an array of 2x8TB HDDs. Let your fingers do the walking in the man pages.
In data venerdì 20 gennaio 2023 00:52:05 CET, Darryl Gregorash ha scritto:
On 2023-01-19 16:56, Carlos E. R. wrote:
On 2023-01-19 21:13, Stakanov wrote:
I have a mdam md0 with two hdd 4 TB. They are in use as /home I now have two HDD with 8TB.
I normally work with mdam in CLI. I did up to now a planed degrading of the secondary disk of the md0. Then a hot remove. Then I added the first 8TB.
with other words: silversurfer:~ # mdadm --manage --set-faulty /dev/md0 /dev/sde1 mdadm: set /dev/sde1 faulty in /dev/md0 silversurfer:~ # mdadm --manage /dev/md0 -r /dev/sde1 mdadm: hot removed /dev/sde1 from /dev/md0 You have new mail in /var/mail/root silversurfer:~ # mdadm --manage /dev/md0 -a /dev/sdg1 mdadm: added /dev/sdg1
I don't know much about this, but, assuming sdg1 is on the new 8TB disk, when you partition it you make it already take the whole disk, ie, the 8TB. Thus the raid will know that one of the members has 8TB. It is then the filesystem which you have to expand, not the raid.
You're right, you don't know much about this. If he doesn't grow the array to 8TB, all he will have is 4TB on an array of 2x8TB HDDs.
Let your fingers do the walking in the man pages.
One other method (but that is somewhat tedious) is, to create the initial RAID with "one missing". Then to do the add once you copied over the content. Normally I would have chosen this, if I would not have the capacity to do the RAID with both 8TB. But as the story goes, I degraded intentionally two RAID so I have the two 8TB free and once the /home is on them, I reconstitute the other RAID so at the end I can have 8TB for /home on RAID 1 (md3) and 4TB on md126 for my KVM machines. currently it syncs the m3 created RAID1 (10 hours!!!) I will sleep over this to see how it ends.
On 2023-01-19 18:25, Stakanov wrote:
In data venerdì 20 gennaio 2023 00:52:05 CET, Darryl Gregorash ha scritto:
On 2023-01-19 16:56, Carlos E. R. wrote:
On 2023-01-19 21:13, Stakanov wrote:
I have a mdam md0 with two hdd 4 TB. They are in use as /home I now have two HDD with 8TB.
I normally work with mdam in CLI. I did up to now a planed degrading of the secondary disk of the md0. Then a hot remove. Then I added the first 8TB.
with other words: silversurfer:~ # mdadm --manage --set-faulty /dev/md0 /dev/sde1 mdadm: set /dev/sde1 faulty in /dev/md0 silversurfer:~ # mdadm --manage /dev/md0 -r /dev/sde1 mdadm: hot removed /dev/sde1 from /dev/md0 You have new mail in /var/mail/root silversurfer:~ # mdadm --manage /dev/md0 -a /dev/sdg1 mdadm: added /dev/sdg1
I don't know much about this, but, assuming sdg1 is on the new 8TB disk, when you partition it you make it already take the whole disk, ie, the 8TB. Thus the raid will know that one of the members has 8TB. It is then the filesystem which you have to expand, not the raid.
You're right, you don't know much about this. If he doesn't grow the array to 8TB, all he will have is 4TB on an array of 2x8TB HDDs.
Let your fingers do the walking in the man pages.
One other method (but that is somewhat tedious) is, to create the initial RAID with "one missing". Then to do the add once you copied over the content. Normally I would have chosen this, if I would not have the capacity to do the RAID with both 8TB. But as the story goes, I degraded intentionally two RAID so I have the two 8TB free and once the /home is on them, I reconstitute the other RAID so at the end I can have 8TB for /home on RAID 1 (md3) and 4TB on md126 for my KVM machines. That's probably the easiest way to do it with a 2-drive RAID1.
currently it syncs the m3 created RAID1 (10 hours!!!) I will sleep over this to see how it ends.
I used to have a 5x3TB RAID5 array. Now I have a 6x6TB RAID5 array. That certainly did not all happen in one day! :D
participants (4)
-
Carlos E. R.
-
Darryl Gregorash
-
Stakanov
-
Stratos Zolotas