projects/rohieb.name-repo: somehow a false line from the draft slipped into the instr...
[www-rohieb-name.git] / blag / post / change-partition-type-without-reformatting.mdwn
1 [[!meta title="Change partition type without reformatting"]]
2 [[!meta date="2011-01-02 17:29"]]
3 [[!meta author="rohieb"]]
4 [[!meta license="CC-BY-SA 3.0"]]
5
6 Note to myself: it is possible to change the partition type of a already
7 formatted (and used) partition. For example, if you have already
8 formatted the partition with NTFS, but accidentally had created it with
9 partition type `0x83` (Linux), so Windows can’t read it, since it expects
10 `0x07` (HPFS/NTFS). On Linux, you can use sfdisk for that purpose:
11
12 # Be root
13 # dd if=/dev/sdb of=sdb-bootsector count=1 # backup boot sector
14 # sfdisk -d /dev/sdb | sed -e 's/Id=83/Id=07/' > /tmp/sdb.txt
15 # sfdisk /dev/sdb < /tmp/sdb.txt
16
17 (fill in the right values for your case)
18
19 Of course, good old fdisk works also, use the `t` command.
20
21 [(Source)](http://serverfault.com/questions/46758/can-you-change-the-partition-type-on-a-linux-server-without-starting-up-fdisk/46840#46840)
22
23 [[!tag hacking howto useless_bits_of_information fdisk Linux
24 Master_Boot_Record NTFS partition partition_table partition_type
25 sfdisk]]
This page took 0.048832 seconds and 5 git commands to generate.