Volume down after attempting repair

NAS326, NAS520, NAS540, NAS542
Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: Volume down after attempting repair

Beitrag von Mijzelf »

Possibly. Depends on what is written to that 1MiB, and if the filesystem cares.

Rebuild the array with the 3 original members, and add a '--bitmap=none' to the commandline. mdadm is picky on the sequence of the arguments, and I don't know where this has to be inserted. Fortunately it will spawn a clear error message when it doesn't fit.

/edit: meanwhile you changed your message, but the answer is yes.

/edit2: The behaviour of mdadm is changed. The page https://linux.die.net/man/8/mdadm doesn't mention that 100G part.

stainless
Beiträge: 12
Registriert: Mo 18. Nov 2019, 01:05

Re: Volume down after attempting repair

Beitrag von stainless »

So i ran

Code: Alles auswählen

sudo mdadm --grow --bitmap=none /dev/md2
which seemed to work, since when i try to run it again it now says that there is no bitmap.

Unfortunately the Data Offset is still the same and the raid remains unmountable.

EDIT
Managed to recreate the array by specifying the data-offset manually.

Code: Alles auswählen

sudo mdadm --create --assume-clean --level=5  --raid-devices=4 --metadata=1.2 --chunk=64K  --layout=left-symmetric [b]--data-offset=262144s[/b] /dev/md2 /dev/sdd3 /dev/sde3 /dev/sdc3 /dev/sda3
I can now mount this and access the data. It also works in the NAS. Would you now recommend still creating it with the 3rd disk missing and adding the new disk again? It got recovered without errors after all.

Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: Volume down after attempting repair

Beitrag von Mijzelf »

The first megabyte of the 3th disk isn't synced, and so contains garbage. (probably zero's). You can have a look if the other disks contain something in the first megabyte. As this is raid5, that is the first 3MiB of the array.
Poor man's data analysis:

Code: Alles auswählen

dd if=/dev/md2 bs=1M count=3 | gzip >md2.gz 
If that compresses to something like 3~4kB, that part of the array is empty.

stainless
Beiträge: 12
Registriert: Mo 18. Nov 2019, 01:05

Re: Volume down after attempting repair

Beitrag von stainless »

It's 189K big. So that means there probably is data?
Would that affect stabilty of the volume or does it just mean that some files may be corrupted?

Mijzelf
Beiträge: 113
Registriert: Mi 14. Nov 2018, 19:50

Re: Volume down after attempting repair

Beitrag von Mijzelf »

If a (forced) filesystemcheck doesn't show errors, the filesystem is consistent, and so there's no stability problem. That data might be some file content, but it could also be a leftover of the raid header. You can have a look inside the archive file. If you see something recognizable it's probably file content. But even then, it still could be a deleted file. That 3MiB is less than a millionth of the total array space. So if the filesystem isn't filled to the rim, odds are that it's garbage.

BTW, you don't need to re-create the whole array to resync that member. Something like

Code: Alles auswählen

mdadm --fail --remove /dev/md2 /dev/sdb2 
mdadm --add /dev/md2 /dev/sdb2
should do. (That /dev/sdb2 is made up. I don't know the real device name).

Antworten