Further to a previous question, I have now opened my MBWE and removed the brand-spanking new drive and "backed up" the whole thing to a 7Gb bz2 file (I'll post it and my backup/recovery crib-sheet another time when I've done some further work) and then transfered the backup file to a blank 1gb drive installed and tested it… all works… so I now have a "full restore" method to a clean factory default.
Now for the next bit I need some help.
The drive is partitioned as follows….
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0001cf00
Device Boot Start End Blocks Id System
/dev/sdc1 5 248 1959930 fd Linux RAID autodetect
/dev/sdc2 249 280 257040 fd Linux RAID autodetect
/dev/sdc3 281 403 987997+ fd Linux RAID autodetect
/dev/sdc4 404 121601 973522935 fd Linux RAID autodetect
31.38MiB is unallocated according to g-parted!!!
sfdisk -d /dev/sdc > sdc_ptable
MBWE$ cat sdc_ptable
- partition table of /dev/sdc
/dev/sdc1 : start= 64260, size= 3919860, Id=fd
/dev/sdc2 : start= 3984120, size= 514080, Id=fd
/dev/sdc3 : start= 4498200, size= 1975995, Id=fd
/dev/sdc4 : start= 6474195, size=1947045870, Id=fd
Now the question….
Obviously I can easily DD the partitions sdc1, sdc2, sdc3, sdc4 and the mbr (sector 1 of the drive (sdc))
But I get the feeling there is a reason for blank space so what I'd like to do is DD from byte 1 of sdc (note no mumber) to 1 byte before sdc1 into a bz2 file. This is where I need help with the maths and DD options!!!!
Now my thinking is …..
By restoring this to any size drive will (a), create all the partitions… sdc4 will be invalid if the drive is smaller than 1TB and not use all the space if the drive is larger than 1TB. and (b) make sure any special info like parition type or special data is saved and re-written correctly.
If sdc4 is invalid or smaller than the drive it can be fixed/expanded fairly easily using normal linux paritioning tools.
If this is unlikely to work then the other idea is to use the sfdisk ptable to re-create the paritions… but for this I would need the "sdc" backup to exclude the MBR record. Again I need help with the DD/maths
OK… next bit…
The partition types are unaloc, ext3, swap, ext3, and xfs (as far as I can tell, linux RAID autodetect (FD) means the OS then looks at the data format of the partition to work out what the underlying file type is)
By DD'ing sdc1, sdc2, sdc3 the underlying file/partition system will be recovered correctly…. I'm guessing I'll need to backup sdc4 using xfsdump, format the new sdc4 partition manually, and xfsrestore it to make sure the FS is intact. I can't use DD as the partition may be a different size if the new disk is not a 1TB drive.
Now assuming this works… then it should allow anyonw to recover or rebuild a MBWE while light single disk device with any size of drive (its not going to be long before 2/3/4 TB drives are available, so for the cost of a bare drive your MBWE can be bigger and better…)
Where this is unlikely to work is with a two drive MBWE in stripe mode (I'm guessing only sdc4 will be striped, and sdc1, 2, 3 will be mirrored) but may work if sdc4 is mirrored… although I would like to think that WD have thought about this and with a 2 drive device the system will boot even if sdc4 is damaged and through the menus you can "re-create/re-build/change" the raid settings. I'm fairly sure they have to some degree… which is why a single drive device has RAID partitions… so in the manufacturing process all they do is dump a single image to a drive for any "type" of MBWE and during the test stage, or first power on, it works out what type of machine it is (single/double drive) and does the biz accordingly… well thats what I would do lol… the KISS principle.
If someone can answer the above questions, I can get to work creating the backups and test senarios for same size and smaller drives (I may not be able to test a larger than 1TB drive)
When I'm done and tested, and if it all works… I'll post the individual backup files.