raid1: All my data completely vanished into the void
Quoted 11 lines · Ross Vandegrift
Are you 100% sure that you didn't do:
mdadm -Cv -n2 -l1
/dev/md0/dev/sda/dev/sdb, etc, etc? (ie, note lack of subdevice for partition!!!)
It sounds like you created md devices out of whole disks instead of partitions and overwrote the partition information. I don't *think* this should be a problem, but I don't 100% know...Try this to see if it finds your array:
mdadm --assemble
/dev/md0/dev/sda/dev/sdb
That works! In fact that does indeed find all the data! I then mount it as /home/big2 and the data is still there that I left before.
You are a genius!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
What an idiot I am.
What does doing
mdadm -Cv -n2 -l1 /dev/md0 /dev/sda /dev/sdb
do to the partition tables???
(And why can I still access the data if I messed up the partitions??? very odd).
Can you point me at an explanation of the effects of what I did?
Every way a person can screw up, it will happen...
Mitcehll
Quoted 8 lines · Mitchell Laks
What does doing
mdadm -Cv -n2 -l1
/dev/md0/dev/sda/dev/sdbdo to the partition tables???
(And why can I still access the data if I messed up the partitions??? very odd).
Can you point me at an explanation of the effects of what I did?
I'd expect that command to overwrite the partition table with the MD metadata, or at least put the partition table at risk of being overwritten later.
No problem, as long as you're aware of it. That's how I usually set my RAID disks up - no partition table, just use the whole disk raw. LVM is a better solution to the partitioning problem.
Signature · 1 line
Sebastian Kuzminsky
Quoted 5 lines · Sebastian Kuzminsky
Quoted 4 lines · Mitchell Laks
What does doing
mdadm -Cv -n2 -l1
/dev/md0/dev/sda/dev/sdb
Quoted 8 lines
Quoted 4 lines
do to the partition tables???
(And why can I still access the data if I messed up the partitions??? very odd).
Can you point me at an explanation of the effects of what I did?I'd expect that command to overwrite the partition table with the MD metadata, or at least put the partition table at risk of being overwritten later.
Nope: the MD metadata lives at the end of the disk, not the start, so your partition table would still be there when the filesystem wrote over the first block of the disk...
...and, if the partition table lived through that, I guess the filesystem doesn't use (or respects) that block itself.
Daniel
Quoted 12 lines · Daniel Pittman
Quoted 10 lines · Sebastian Kuzminsky
Quoted 6 lines · Mitchell Laks
What does doing
mdadm -Cv -n2 -l1
/dev/md0/dev/sda/dev/sdbdo to the partition tables??? (And why can I still access the data if I messed up the partitions??? very odd). Can you point me at an explanation of the effects of what I did?
I'd expect that command to overwrite the partition table with the MD metadata, or at least put the partition table at risk of being overwritten later.
Quoted 6 lines
Nope: the MD metadata lives at the end of the disk, not the start, so your partition table would still be there when the filesystem wrote over the first block of the disk...
....and, if the partition table lived through that, I guess the filesystem doesn't use (or respects) that block itself.
...but, just so as I understand, by using the whole disk (ie /dev/sda and not /dev/sda1, etc), you're telling md to make the whole disk available to your filesystem (or whatever), including the space normally used to store the partition table, and so any partition table that happens to be on the disk(s) is likely to be over-written.
right?
Max.
Quoted 19 lines · Max Waterman
Quoted 9 lines · Daniel Pittman
Quoted 8 lines · Sebastian Kuzminsky
Quoted 7 lines · Mitchell Laks
What does doing
mdadm -Cv -n2 -l1
/dev/md0/dev/sda/dev/sdbdo to the partition tables??? (And why can I still access the data if I messed up the partitions??? very odd).
Can you point me at an explanation of the effects of what I did?Quoted 8 lines
Quoted 3 lines
I'd expect that command to overwrite the partition table with the MD metadata, or at least put the partition table at risk of being overwritten later.
Nope: the MD metadata lives at the end of the disk, not the start, so your partition table would still be there when the filesystem wrote over the first block of the disk...
....and, if the partition table lived through that, I guess the filesystem doesn't use (or respects) that block itself.
Quoted 7 lines
...but, just so as I understand, by using the whole disk (ie
/dev/sdaand not/dev/sda1, etc), you're telling md to make the whole disk available to your filesystem (or whatever), including the space normally used to store the partition table, and so any partition table that happens to be on the disk(s) is likely to be over-written.right?
Yeah, pretty much. You lose around 128KB from the end of the disk, but the MD device should start the data at sector zero, right where the partition table is.
Daniel
Quoted 3 lines
What does doing
mdadm -Cv -n2 -l1/dev/md0/dev/sda/dev/sdb
do to the partition tables???
overwrites them. then again, there's nothing critical about partition tables - they're just a convention for slicing up the disk, not necessary in any sense.
in fact, it can be quite handy to avoid partitions - I have one cluster where /dev/hda is an ext3 filesystem, mainly to avoid the bios bug of trying to boot the disk (in preference to PXE) even if there are no active partitions.
the only downside to your "messed up" config is that the kernel won't autostart the raids.