swap partitions are set as type 83
Bug #36268 reported by
Alexandre Otto Strube
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gparted (Ubuntu) |
Fix Released
|
Medium
|
Daniel Holbach |
Bug Description
Creating a swap partition in gparted does not work. It sets it as type 83, which
is incorrect, thus making fdisk list it as Linux type.
http://
To post a comment you must log in.
I just checked gparted's source. It simply calls mkswap, which doesn't set
partition type.
According to mkswap's manpage:
" The device argument will usually be a disk partition (something like
/dev/hda4 or /dev/sdb7) but can also be a file. The Linux kernel does
not look at partition Id’s, but many installation scripts will assume
that partitions of hex type 82 (LINUX_SWAP) are meant to be swap parti‐
tions. (Warning: Solaris also uses this type. Be careful not to kill
your Solaris partitions.)
"
This glitch lies in linux_swap.cc, from line 49 to 52:
bool linux_swap::Create( const Partition & new_partition )
{
return ! Execute_Command( "mkswap " + new_partition .partition ) ;
}
perhaps a call after the mkswap command, something like: sfdisk --change-id
/dev/hdb 5 83 (well, you got the idea - this is sfdisk's manpage example :-) ).