Saturday, April 25, 2015

partitioning - How to renumber a partition?


I used to have a primary partition, /dev/sdb1, and an extended partition, /dev/sdb2. Since I deleted sdb1 and merged it into sdb2, I’ve been trying to think of a way to modify the id '/dev/sdb2' to '/dev/sdb1' (beacuse there won’t be /dev/sdb1 anymore).


There’s also two logical partitions inside /dev/sdb2: /dev/sdb5 and /dev/sdb6.


Is there an easy way to modify the numeric id?


My partition table looks like this:


Device Boot     Start        End     Blocks  Id  System
----------------------------------------------------------------
/dev/sdb2 2048 234440703 117219328 f W95 Ext’d (LBA)
/dev/sdb5 16065 87249014 43616475 7 HPFS/NTFS/exFAT
/dev/sdb6 87251063 234440703 73594820+ 7 HPFS/NTFS/exFAT
Nr AF Hd Sec Cly Hd Sec Cly Start Size ID
----------------------------------------------------------
1 00 0 0 0 0 0 0 0 0 00
2 00 32 33 0 254 63 1023 2048 234438656 0f
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00
5 00 0 1 1 254 63 1023 14017 87232950 07
6 00 32 33 311 254 63 1023 2048 147189641 07

Answer



Delete the partitions, and recreate them in exactly the same positions. Make sure you are using sectors as the unit to avoid rounding errors.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...