The answer to your IT questions
 

Advanced search  • Search tips
My QUESTIONS & ANSWERS
 Question:

Is a linux partition primary or extended?

User Asked by: milen
Published on: 09:32/13.01.2009
Status: OPEN
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?
 Answers: 1
Sort by: /\ date | rating
Image Answer by: xpert
Posted on: 08:32/13.01.2009
Rating: 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
  
| Home | Hall of fame | Register | Log in | Terms of service | Help | Contacts |