Bug 1151790 - gpart doesn't work
Summary: gpart doesn't work
Alias: None
Product: Fedora
Classification: Fedora
Component: gpart
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-10-11 22:12 UTC by Samuel Sieb
Modified: 2014-12-06 10:13 UTC (History)
1 user (show)

Fixed In Version: gpart-0.2.1-1.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-11-27 08:38:37 UTC
Type: Bug

Attachments (Terms of Use)

Description Samuel Sieb 2014-10-11 22:12:00 UTC
I tried running gpart on my flash drive:

# gpart /dev/sdb

*** Fatal error: dev(/dev/sdb): seek failure.

I used strace to get this:
20319 open("/dev/sdb", O_RDONLY)        = 3
20319 write(2, "\n*** Fatal error: dev(/dev/sdb): seek failure.\n", 47) = 47
20319 exit_group(1)  

It reports a seek failure without actually doing a seek.

The URL listed in the RPM doesn't actually exist any more.  Checking the src.rpm, I find the code looks like:

off64_t l64seek(int fd,off64_t offset,int whence)
        off64_t         ret = (off64_t)-1;

#if defined(__linux__) && defined(__i386__)
        int             iret;
        unsigned long   ohi, olo;

        ohi = (unsigned long)((offset >> 32) & 0xFFFFFFFF);
        olo = (unsigned long)(offset & 0xFFFFFFFF);
        iret = syscall(__NR__llseek,fd,ohi,olo,&ret,whence);
        if (iret == -1)
                ret = (off64_t)-1;

#if defined(__FreeBSD__) || (defined(__linux__) && defined(__alpha__))
        ret = lseek(fd,offset,whence);

        return (ret);

My guess is that those defines aren't matched on a 64-bit system.  The URL listed in the RPM doesn't exist any more.  Searching around, I found source code at https://github.com/baruch/gpart .  I downloaded that and compiled it and it works.  The relevant code is now:

off64_t l64seek(int fd,off64_t offset,int whence)
        off64_t         ret = (off64_t)-1;

        ret = lseek(fd,offset,whence);
        if (ret < 0)

        return (ret);

Please update to this version.  In configure.ac, it requires automake 1.14, but I changed it to 1.13 and it worked.

Comment 1 David Cantrell 2014-10-13 19:15:22 UTC
Wow, didn't know anyone was still using this program.  The last time I did anything to it was August 2013.  And it was June 2013 prior to that.

I'll see what it takes to update to this new fork of the project since the real one has been dead upstream for a long time.

Comment 2 Fedora Update System 2014-10-13 19:56:15 UTC
gpart-0.2.1-1.fc20 has been submitted as an update for Fedora 20.

Comment 3 Fedora Update System 2014-10-13 20:13:29 UTC
gpart-0.2.1-1.fc21 has been submitted as an update for Fedora 21.

Comment 4 Samuel Sieb 2014-10-13 20:21:19 UTC
Well, it's not very critical for me.  I just tried out the recovery option on gparted and it pointed to gpart which didn't work.

Thanks for the update, it works.  I wonder how long it will take to get enough karma for stable. :-)

Comment 5 Fedora Update System 2014-10-16 01:58:06 UTC
Package gpart-0.2.1-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gpart-0.2.1-1.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2014-11-27 08:38:37 UTC
gpart-0.2.1-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2014-12-06 10:13:25 UTC
gpart-0.2.1-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.