swap partitions are set as type 83

Bug #36268 reported by Alexandre Otto Strube
14
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://bugzilla.gnome.org/show_bug.cgi?id=322281: http://bugzilla.gnome.org/show_bug.cgi?id=322281

Revision history for this message
Alexandre Otto Strube (surak) wrote :

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 :-) ).

Revision history for this message
Alexandre Otto Strube (surak) wrote :
Revision history for this message
Alexandre Otto Strube (surak) wrote :

we have an answer from upstream:

------- Additional Comment #1 From plors 2005-11-23 23:55 UTC -------

Hi,

This is a known issue which is easy fixable. If everything goes as planned i'll
fix this tomorrow morning.

Thanks anyway for reporting :)

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thank you for investigating.

Revision history for this message
Alexandre Otto Strube (surak) wrote :

------- Additional Comment #2 From plors 2005-11-24 16:00 UTC -------

fixed in CVS

It will be in time for dapper, I presume. It's part of gnome, so it will be
there. Closing it, ok?

Revision history for this message
Daniel Holbach (dholbach) wrote :

I mark it PENDINGUPLOAD until I have uploaded it to Dapper. Thanks for taking
care. :-)

Revision history for this message
Daniel Holbach (dholbach) wrote :

I have the upload prepared already, but have to wait for the C++ allocator
change to happen.

Revision history for this message
Daniel Holbach (dholbach) wrote :

 gparted (0.0.9-0ubuntu1) dapper; urgency=low
 .
   * New upstream release:
     - gparted finally has a logo/icon ;) (thanks to Alain Clement)
       see also #162092
     - minor cleanups
     - correct partitiontype is now set after creation or conversion.
       (#322281) (Ubuntu: #20013)
     - changes already covered in our CVS checkouts.
   * debian/patches/privileged.patch:
     - updated.
   * debian/patches/changed-menu-icon.patch,
     debian/gparted.png.uuencoded:
     - dropped, upstream has their own icon.
   * debian/rules:
     - don't install pixmaps.
   * debian/control:
     - don't depend on sharutils any more (uudecode).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.