Home > hacking, howto, useless bits of information > Change partition type without reformatting

Change partition type without reformatting

Note to myself: it is possible to change the partition type of a already formatted (and used) partition. For example, if you have already formatted the partition with NTFS, but accidentally had created it with partition type 0x83 (Linux), so Windows can’t read it, since it expects 0x07 (HPFS/NTFS). On Linux, you can use sfdisk for that purpose:

# Be root
dd if=/dev/sdb of=sdb-bootsector count=1  # backup boot sector
sfdisk -d /dev/sdb | sed -e 's/Id=83/Id=07/' > /tmp/sdb.txt   
sfdisk /dev/sdb < /tmp/sdb.txt

(fill in the right values for your case)

Of course, good old fdisk works also, use the t command.

(Source)

Flattr this

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: