in Advanced 

Question preview

HomeQuestion preview:
Log in

Is a linux partition primary or extended?

One of my hard disks on my RAID 1 Linux system have failed. I've replaced it and I want to create the same partitions I have on the other hard disk. What is the linux command for determining is the partition primary or extended?
Do you know someone who could answer? Ask him for help
Answers: 1
Sort by: date rating
image xpert
10:32/13.01.2009
1 from possible 5 with 1 votes
With the linux command sfdisk you can dump your partitions in sfdisk readable format:
(I copy this output from a debian installation)
> sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=        1, size=  4209029, Id=fd
/dev/sda2 : start=  4209030, size=972559035, Id=fd
/dev/sda3 : start=        0, size=        0, Id= 0
/dev/sda4 : start=        0, size=        0, Id= 0


Well, you don't need to understand if your partitions are primary or extended. You can directly copy partitions from healthy hard drive to the new one.

This code copies the partitions from harddrive A to harddrive B:
sfdisk -d /dev/sda | sfdisk /dev/sdb

Then you can start your recovery with the command ( of course you need to pass correct md0 or md1 corresponding to your partitions):
mdadm /dev/md0 -a /dev/sdb1
mdadm /dev/md1 -a /dev/sdb2
Vote:
Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
Ask question
| Home | Hall of fame | Registration | Log in | Terms of service | Privacy policy | Help | Contacts | RSS |