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.