Copying hard drive partition structure
by goylik999 from LinuxQuestions.org on (#5C5ZS)
I'm trying to copy the partition structure of a drive that died, all the info I have is that it has an MBR, uses an msdos partition table (not sure if this matters?) and has 9 partitions and looks something like this:
/dev/sda,sector 0 is MBR
/dev/sda1 is kernel (RAW) - 190MB
/dev/sda2 is swap (SWAP) - 478MB
/dev/sda4 is rescue (RAW) - 190MB
/dev/sda5 is root - ext3 - 4.66GB
/dev/sda6 is app - ext3 - 4.66GB
/dev/sda7 is config - ext3 - 6.1MB
/dev/sda8 is user - ext3 - 956MB
/dev/sda9 is maps - ext3 - rest of drive
Since sda3 is "missing" I'm guessing that's the extended partition? However when trying to do that in gparted or the Ubuntu disk tool, the next logical partition gets named sda5 instead of sda4. I'm going to be copying filesystems to the drive that have hardcoded device names in all the scripts so the numbers need to match exactly.
Is there a way to rename the sda5 to sda4? Or maybe I'm completely off on the extended partition thing?
Any help would be greatly appreciated, thanks.


/dev/sda,sector 0 is MBR
/dev/sda1 is kernel (RAW) - 190MB
/dev/sda2 is swap (SWAP) - 478MB
/dev/sda4 is rescue (RAW) - 190MB
/dev/sda5 is root - ext3 - 4.66GB
/dev/sda6 is app - ext3 - 4.66GB
/dev/sda7 is config - ext3 - 6.1MB
/dev/sda8 is user - ext3 - 956MB
/dev/sda9 is maps - ext3 - rest of drive
Since sda3 is "missing" I'm guessing that's the extended partition? However when trying to do that in gparted or the Ubuntu disk tool, the next logical partition gets named sda5 instead of sda4. I'm going to be copying filesystems to the drive that have hardcoded device names in all the scripts so the numbers need to match exactly.
Is there a way to rename the sda5 to sda4? Or maybe I'm completely off on the extended partition thing?
Any help would be greatly appreciated, thanks.