After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 419515 - Failure to detect 'linux-swap' filesystems, when used with libparted 1.8.3.
Failure to detect 'linux-swap' filesystems, when used with libparted 1.8.3.
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other All
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2007-03-17 21:35 UTC by Debarshi Ray
Modified: 2009-01-06 22:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Preliminary patch to fix this bug. (2.32 KB, patch)
2007-03-17 21:37 UTC, Debarshi Ray
none Details | Review

Description Debarshi Ray 2007-03-17 21:35:32 UTC
Please describe the problem:
Libparted now differentiates between the older and newer versions of the 'linux-swap' filesystem, which are denoted by 'linux-swap(old)' and 'linux-swap(new)'. Since GParted is still using the older 'linux-swap' string, it marks these partitions as 'unknown'.

Steps to reproduce:
1. Make sure you have a  'linux-swap' partition and start GParted.
2. Have a look at the entry for the 'linux-swap' partion.



Actual results:
The partition having the 'linux-swap' filesystem is marked as 'unknown'.

Expected results:
It should have been correctly identified as a 'linux-swap' filesystem.

Does this happen every time?
Yes, whenever any partition has such a filesystem.

Other information:
Here is a preliminary patch to fix this: http://glug-nith.org/~rishi/download/src/libparted-1.8.3.diff

It should also work with older versions of libparted which do not differentiate between the older and newer versions. I have not changed the colour coding used to denote the older and newer versions of 'linux-swap' and kept the same colour being used by 'linux-swap' before.
Comment 1 Debarshi Ray 2007-03-17 21:37:30 UTC
Created attachment 84792 [details] [review]
Preliminary patch to fix this bug.

It should also work with older versions of libparted which do not differentiate between the older and newer versions. I have not changed the colour coding used to denote the older and newer versions of 'linux-swap' and kept the same colour being used by 'linux-swap' before.
Comment 2 Laurent de Trogoff 2007-03-18 10:50:07 UTC
Rishi :)
As you know (I guess you know :-p) parted-1.8.3 is very new. 
Plors *must* write some code to make GParted able to be compiled against parted-1.8.3.

I hope he will soon, but ... not sure he will find enough time.
Thx for reporting.
Comment 3 Laurent de Trogoff 2007-03-18 10:51:50 UTC
Sorry :-/ I didn't take care of your second post :)
THX ! I will try asap.
Comment 4 Laurent de Trogoff 2007-03-19 20:14:43 UTC
Rishi, your patch half-works : http://gparted.free.fr/screenshots/linux-swap_2.jpg

but it is the beginning of the solution :)
Comment 5 Debarshi Ray 2007-03-20 13:05:14 UTC
http://glug-nith.org/~rishi/download/src/libparted-1.8.5.diff

This one involves more invasive changes to GParted, but I am unable to figure out why it is not being able to detect the mount-point for a partition having a 'linux-swap...' filesystem.

However I have a feeling that we finally would have to split the 'linux_swap' class to into separate ones for the old and new formats. We still have not touched the issue of 'swsusp' partitions, which libparted now supports. :-)
Comment 6 Curtis Gedak 2008-03-27 19:15:31 UTC
Hi Debarshi,

My name is Curtis Gedak and I'm the new C++ developer for GParted.  Today I tried compiling GParted-0.3.6 using Parted-1.8.8, and there _appears_ to be no problem with recognizing linux-swap.  GParted listed my swap partitions as "linux-swap".

Has this problem disappeared with parted-1.8.8, or am I not looking in the proper place?

Any help you can provide with this problem would be greatly appreciated.

Regards,
Curtis


If it helps, here is the output from parted for my hard drive:

$ parted /dev/sdb print unit s print unit chs print
Model: ATA ST3160022ACE (scsi)
Disk /dev/sdb: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  10.6GB  10.6GB  primary   ntfs              
 2      10.6GB  21.6GB  11.1GB  primary   ext2              
 3      21.6GB  32.1GB  10.5GB  primary   reiserfs          
 4      32.1GB  160GB   128GB   extended                    
 5      32.1GB  37.5GB  5371MB  logical   ext3              
 6      37.5GB  41.8GB  4285MB  logical   fat16             
 7      41.8GB  47.2GB  5437MB  logical   fat32             
 8      47.2GB  51.3GB  4063MB  logical   jfs               
 9      51.3GB  51.7GB  436MB   logical   linux-swap        
10      51.7GB  57.8GB  6062MB  logical                     
11      57.8GB  65.4GB  7567MB  logical   xfs               
12      65.4GB  67.5GB  2139MB  logical   hfs               
13      67.5GB  84.0GB  16.5GB  logical   fat32             

Model: ATA ST3160022ACE (scsi)
Disk /dev/sdb: 312581808s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size        Type      File system  Flags
 1      63s         20627459s   20627397s   primary   ntfs              
 2      20627460s   42234884s   21607425s   primary   ext2              
 3      42234885s   62782019s   20547135s   primary   reiserfs          
 4      62782020s   312576704s  249794685s  extended                    
 5      62782083s   73272464s   10490382s   logical   ext3              
 6      73272528s   81642329s   8369802s    logical   fat16             
 7      81642393s   92261294s   10618902s   logical   fat32             
 8      92261358s   100197404s  7936047s    logical   jfs               
 9      100197468s  101048849s  851382s     logical   linux-swap        
10      101048913s  112888754s  11839842s   logical                     
11      112888818s  127668554s  14779737s   logical   xfs               
12      127668618s  131845454s  4176837s    logical   hfs               
13      131845518s  164007584s  32162067s   logical   fat32             

Model: ATA ST3160022ACE (scsi)
Disk /dev/sdb: 19457,80,62
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 19457,255,63.  Each cylinder is 8225kB.
Partition Table: msdos

Number  Start     End           Type      File system  Flags
 1      0,1,0     1283,254,62   primary   ntfs              
 2      1284,0,0  2628,254,62   primary   ext2              
 3      2629,0,0  3907,254,62   primary   reiserfs          
 4      3908,0,0  19456,254,62  extended                    
 5      3908,1,0  4560,254,62   logical   ext3              
 6      4561,1,0  5081,254,62   logical   fat16             
 7      5082,1,0  5742,254,62   logical   fat32             
 8      5743,1,0  6236,254,62   logical   jfs               
 9      6237,1,0  6289,254,62   logical   linux-swap        
10      6290,1,0  7026,254,62   logical                     
11      7027,1,0  7946,254,62   logical   xfs               
12      7947,1,0  8206,254,62   logical   hfs               
13      8207,1,0  10208,254,62  logical   fat32
Comment 7 Debarshi Ray 2008-03-28 11:57:30 UTC
The following commit to Parted fixes this issue in libparted itself:
commit eb00dfeab241b9943138b33c9946da1e603d912a
Author: Jim Meyering <jim@meyering.net>
Date:   Mon Aug 13 22:36:27 2007 +0200

Basically libparted looks for a prefix of "linux-swap" instead of trying to match the entire string.

If you are satisfied you can close this bug.
Comment 8 Curtis Gedak 2008-03-31 14:55:20 UTC
Thank you for the update Debarshi.  I will close this bug.
Comment 9 Curtis Gedak 2009-01-03 22:17:15 UTC
Hi Debarshi,

It turns out that this is still a problem with the GIT version of parted.

Thanks for the patch you submitted.

Is there any reason why a user would need to know that linux-swap is new or old?
I haven't known about this and it hasn't impacted me when I've been setting up GNU/Linux systems.

My thought is to have "linux-swap", "linux-swap(new)", and "linux-swap(old)" all recognized simply as "linux-swap" in GParted.

What are your thoughts?

Regards,
Curtis
Comment 10 Curtis Gedak 2009-01-06 22:45:06 UTC
In trying to stay aligned with the KISS philosophy (Keep It Simple Stupid), I have decided that all three linux-swap types returned by various versions of libparted will be reported as "linux-swap" in GParted.

This change has been committed to the gnome SVN repository for inclusion in the next release of GParted (0.4.2).  Closing this bug (again :-).