gparted doesn't support sector sizes > 512

Bug #405022 reported by Linus Hoppe
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
GNU Parted
Confirmed
Undecided
Unassigned
GParted
Fix Released
Medium
NULL Project
Invalid
Undecided
Unassigned
gparted (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gparted

terminal:

linus@dell_laptop:~$ sudo gparted
======================
libparted : 1.8.8
======================
Das Gerät /dev/sdb hat eine logische Sektorgröße von 2048. Nicht alle Teile von GNU Parted unterstützen dies im Moment und der funktionierende Code ist HOCH EXPERIMENTELL.

*** stack smashing detected ***: /usr/sbin/gpartedbin terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb71c5da8]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb71c5d60]
/lib/libparted-1.8.so.10[0xb8019854]
/lib/libparted-1.8.so.10[0xb7fe89fd]
[0x0]
======= Memory map: ========
08048000-0810c000 r-xp 00000000 08:01 2402568 /usr/sbin/gpartedbin
0810c000-0810d000 r--p 000c3000 08:01 2402568 /usr/sbin/gpartedbin
0810d000-0810e000 rw-p 000c4000 08:01 2402568 /usr/sbin/gpartedbin
0810e000-0810f000 rw-p 0810e000 00:00 0
0899a000-08d2f000 rw-p 0899a000 00:00 0 [heap]
b3700000-b3721000 rw-p b3700000 00:00 0
b3721000-b3800000 ---p b3721000 00:00 0
b38f9000-b3959000 rw-s 00000000 00:09 1343505 /SYSV00000000 (deleted)
b3959000-b396c000 r--p 00000000 08:01 2688688 /usr/share/locale-langpack/de/LC_MESSAGES/parted.mo
b396c000-b396d000 ---p b396c000 00:00 0
b396d000-b416d000 rw-p b396d000 00:00 0
b416d000-b41cd000 rw-s 00000000 00:09 1310736 /SYSV00000000 (deleted)
b41cd000-b4203000 r-xp 00000000 08:01 12689526 /lib/libdbus-1.so.3.4.0
b4203000-b4204000 r--p 00035000 08:01 12689526 /lib/libdbus-1.so.3.4.0
b4204000-b4205000 rw-p 00036000 08:01 12689526 /lib/libdbus-1.so.3.4.0
b4205000-b4217000 r-xp 00000000 08:01 2403529 /usr/lib/libgvfscommon.so.0.0.0
b4217000-b4218000 r--p 00012000 08:01 2403529 /usr/lib/libgvfscommon.so.0.0.0
b4218000-b4219000 rw-p 00013000 08:01 2403529 /usr/lib/libgvfscommon.so.0.0.0
b4222000-b4226000 r-xp 00000000 08:01 6562798 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
b4226000-b4227000 r--p 00003000 08:01 6562798 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
b4227000-b4228000 rw-p 00004000 08:01 6562798 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
b4228000-b4242000 r--s 00000000 08:01 2498760 /usr/share/mime/mime.cache
b4242000-b4251000 r-xp 00000000 08:01 2425087 /usr/lib/gio/modules/libgioremote-volume-monitor.so
b4251000-b4252000 r--p 0000e000 08:01 2425087 /usr/lib/gio/modules/libgioremote-volume-monitor.so
b4252000-b4253000 rw-p 0000f000 08:01 2425087 /usr/lib/gio/modules/libgioremote-volume-monitor.so
b4253000-b5a2d000 r--p 00000000 08:01 2500685 /usr/local/share/icons/hicolor/icon-theme.cache
b5a2d000-b6a50000 r--p 00000000 08:01 2637880 /usr/share/icons/hicolor/icon-theme.cache
b6a50000-b6afb000 r--p 00000000 08:01 2638149 /usr/share/icons/Tangerine/icon-theme.cache
b6afb000-b6b93000 r--p 00000000 08:01 10895367 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
b6b93000-b6b95000 r-xp 00000000 08:01 2482321 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
b6b95000-b6b96000 r--p 00001000 08:01 2482321 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
b6b96000-b6b97000 rw-p 00002000 08:01 2482321 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
b6b97000-b6b9d000 r--s 00000000 08:01 6825339 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-x86.cache-2
b6b9d000-b6ba0000 r--s 00000000 08:01 6825795 /var/cache/fontconfig/e383d7ea5fbe662a33d9b44caf393297-x86.cache-2
b6ba0000-b6ba2000 r--s 00000000 08:01 6825775 /var/cache/fontconfig/c69f04ab05004e31a6d5e715764f16d8-x86.cache-2
b6ba2000-b6ba5000 r--s 00000000 08:01 6825769 /var/cache/fontconfig/6eb3985aa4124903f6ff08ba781cd364-x86.cache-2
b6ba5000-b6ba6000 r--s 00000000 08:01 6825759 /var/cache/fontconfig/4c73fe0c47614734b17d736dbde7580a-x86.cache-2
b6ba6000-b6ba9000 r--s 00000000 08:01 6825757 /var/cache/fontconfig/a755afe4a08bf5b97852ceb7400b47bc-x86.cache-2
b6ba9000-b6bb0000 r--s 00000000 08:01 6825746 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-x86.cache-2
b6bb0000-b6bb3000 r--s 00000000 08:01 6825730 /var/cache/fontconfig/de156ccd2eddbdc19d37a45b8b2aac9c-x86.cache-2
b6bb3000-b6bbb000 r--s 00000000 08:01 6825711 /var/cache/fontconfig/e3de0de479f42330eadf588a55fb5bf4-x86.cache-2
b6bbb000-b6bc6000 r--s 00000000 08:01 6825692 /var/cache/fontconfig/0f34bcd4b6ee430af32735b75db7f02b-x86.cache-2

Revision history for this message
Vish (vish) wrote :

Did this problem occur in the the HardDrive install or LiveCD ?

Changed in hundredpapercuts:
status: New → Incomplete
Revision history for this message
Jan Claeys (janc) wrote :

Can you try with parted from the commandline and see what that gives?

It's probably libparted that causes the crash, related to what the warning says?
(Maybe Ubuntu should remove that experimental code from libparted...)

Revision history for this message
Linus Hoppe (linus-hoppe-deactivatedaccount) wrote :
Download full text (6.2 KiB)

The Problem occurs in the HardDrive, I've also tried to use Ubuntu Karmic in a virual machine, it also fails.

I'm trying from the commandline with parted:

linus@dell_laptop:~$ sudo parted
GNU Parted 1.8.8
Verwende /dev/sda
Willkommen zu GNU Parted! Geben Sie 'help' ein, um eine Liste der verfügbaren Kommados zu erhalten.
(parted) print all
Modell: ATA WDC WD3200BEVT-7 (scsi)
Festplatte /dev/sda: 320GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos

Anzahl Beginn Ende Größe Typ Dateisystem Flags
 1 32,3kB 309GB 309GB primary ext3 boot
 2 309GB 320GB 10,9GB extended
 5 309GB 320GB 10,9GB logical linux-swap

*** stack smashing detected ***: <unknown> terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7e18da8]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7e18d60]
/lib/libparted-1.8.so.10[0xb7f38854]
/lib/libparted-1.8.so.10[0xb7f079fd]
[0x0]
======= Memory map: ========
08048000-0805b000 r-xp 00000000 08:01 1146887 /sbin/parted
0805b000-0805c000 r--p 00012000 08:01 1146887 /sbin/parted
0805c000-0805d000 rw-p 00013000 08:01 1146887 /sbin/parted
09312000-09351000 rw-p 09312000 00:00 0 [heap]
b7ba1000-b7bb4000 r--p 00000000 08:01 2688688 /usr/share/locale-langpack/de/LC_MESSAGES/parted.mo
b7bb4000-b7bf3000 r--p 00000000 08:01 13631489 /usr/lib/locale/de_DE.utf8/LC_CTYPE
b7bf3000-b7cde000 r--p 00000000 08:01 2441501 /usr/lib/locale/de_DE.utf8/LC_COLLATE
b7cde000-b7cdf000 rw-p b7cde000 00:00 0
b7cdf000-b7cf7000 r-xp 00000000 08:01 12689516 /lib/libselinux.so.1
b7cf7000-b7cf8000 r--p 00017000 08:01 12689516 /lib/libselinux.so.1
b7cf8000-b7cf9000 rw-p 00018000 08:01 12689516 /lib/libselinux.so.1
b7cf9000-b7cfa000 rw-p b7cf9000 00:00 0
b7cfa000-b7cfd000 r-xp 00000000 08:01 12689515 /lib/libuuid.so.1.2
b7cfd000-b7cfe000 r--p 00002000 08:01 12689515 /lib/libuuid.so.1.2
b7cfe000-b7cff000 rw-p 00003000 08:01 12689515 /lib/libuuid.so.1.2
b7cff000-b7d14000 r-xp 00000000 08:01 12689440 /lib/libdevmapper.so.1.02.1
b7d14000-b7d15000 r--p 00014000 08:01 12689440 /lib/libdevmapper.so.1.02.1
b7d15000-b7d17000 rw-p 00015000 08:01 12689440 /lib/libdevmapper.so.1.02.1
b7d17000-b7d19000 r-xp 00000000 08:01 12706167 /lib/tls/i686/cmov/libdl-2.9.so
b7d19000-b7d1a000 r--p 00001000 08:01 12706167 /lib/tls/i686/cmov/libdl-2.9.so
b7d1a000-b7d1b000 rw-p 00002000 08:01 12706167 /lib/tls/i686/cmov/libdl-2.9.so
b7d1b000-b7e77000 r-xp 00000000 08:01 12706161 /lib/tls/i686/cmov/libc-2.9.so
b7e77000-b7e78000 ---p 0015c000 08:01 12706161 /lib/tls/i686/cmov/libc-2.9.so
b7e78000-b7e7a000 r--p 0015c000 08:01 12706161 /lib/tls/i686/cmov/libc-2.9.so
b7e7a000-b7e7b000 rw-p 0015e000 08:01 12706161 /lib/tls/i686/cmov/libc-2.9.so
b7e7b000-b7e7e000 rw-p b7e7b000 00:00 0
b7e7e000-b7ead000 r-xp 00000000 08:01 12689490 /lib/libncurses.so.5.7
b7ead000-b7eaf000 r--p 0002e000 08:01 12689490 /lib/libncurses.so.5.7
b7eaf000-b7eb0000 rw-p 00030000 08:01 12689490 /lib/libncurses.so.5.7
b7eb0000-b7eb1000 rw-p b7eb0000 00:00 0
b7e...

Read more...

Revision history for this message
Vish (vish) wrote :

Thank you for bringing this bug to our attention. Unfortunately a paper cut should be a small usability issue that affects many people and is quick and easy to fix. I'm afraid this bug can't be addressed as part of this project.

gparted is *not* part of the default install , hence not a papercut.

A paper cut is a minor usability annoyance that an average user would encounter on his/her first day of using a new installation of Ubuntu 9.10.

For further info about papercuts criteria , pls read > https://wiki.ubuntu.com/PaperCut

Don't worry though, This bug has been marked as "invalid" ONLY in the papercuts project.

Changed in hundredpapercuts:
status: Incomplete → Invalid
Revision history for this message
Linus Hoppe (linus-hoppe-deactivatedaccount) wrote :
Download full text (8.7 KiB)

I've started gparted with valgrind (command: sudo G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log /usr/sbin/gparted). Log-File attached.

Termial output:

======================
libparted : 1.8.8
======================
Das Gerät /dev/sdb hat eine logische Sektorgröße von 2048. Nicht alle Teile von GNU Parted unterstützen dies im Moment und der funktionierende Code ist HOCH EXPERIMENTELL.

*** stack smashing detected ***: /usr/sbin/gpartedbin terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7130da8]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7130d60]
/lib/libparted-1.8.so.10[0xb7f84854]
/lib/libparted-1.8.so.10[0xb7f539fd]
[0x0]
======= Memory map: ========
08048000-0810c000 r-xp 00000000 08:01 2402568 /usr/sbin/gpartedbin
0810c000-0810d000 r--p 000c3000 08:01 2402568 /usr/sbin/gpartedbin
0810d000-0810e000 rw-p 000c4000 08:01 2402568 /usr/sbin/gpartedbin
0810e000-0810f000 rw-p 0810e000 00:00 0
08f15000-09224000 rw-p 08f15000 00:00 0 [heap]
b3700000-b377a000 rw-p b3700000 00:00 0
b377a000-b3800000 ---p b377a000 00:00 0
b3864000-b38c4000 rw-s 00000000 00:09 1245204 /SYSV00000000 (deleted)
b38c4000-b38d7000 r--p 00000000 08:01 2688688 /usr/share/locale-langpack/de/LC_MESSAGES/parted.mo
b38d7000-b38d8000 ---p b38d7000 00:00 0
b38d8000-b40d8000 rw-p b38d8000 00:00 0
b40d8000-b4138000 rw-s 00000000 00:09 1212435 /SYSV00000000 (deleted)
b4138000-b416e000 r-xp 00000000 08:01 12689526 /lib/libdbus-1.so.3.4.0
b416e000-b416f000 r--p 00035000 08:01 12689526 /lib/libdbus-1.so.3.4.0
b416f000-b4170000 rw-p 00036000 08:01 12689526 /lib/libdbus-1.so.3.4.0
b4170000-b4182000 r-xp 00000000 08:01 2403529 /usr/lib/libgvfscommon.so.0.0.0
b4182000-b4183000 r--p 00012000 08:01 2403529 /usr/lib/libgvfscommon.so.0.0.0
b4183000-b4184000 rw-p 00013000 08:01 2403529 /usr/lib/libgvfscommon.so.0.0.0
b418d000-b4191000 r-xp 00000000 08:01 6562798 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
b4191000-b4192000 r--p 00003000 08:01 6562798 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
b4192000-b4193000 rw-p 00004000 08:01 6562798 /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
b4193000-b41ad000 r--s 00000000 08:01 2498760 /usr/share/mime/mime.cache
b41ad000-b41bc000 r-xp 00000000 08:01 2425087 /usr/lib/gio/modules/libgioremote-volume-monitor.so
b41bc000-b41bd000 r--p 0000e000 08:01 2425087 /usr/lib/gio/modules/libgioremote-volume-monitor.so
b41bd000-b41be000 rw-p 0000f000 08:01 2425087 /usr/lib/gio/modules/libgioremote-volume-monitor.so
b41be000-b5998000 r--p 00000000 08:01 2500685 /usr/local/share/icons/hicolor/icon-theme.cache
b5998000-b69bb000 r--p 00000000 08:01 2637880 /usr/share/icons/hicolor/icon-theme.cache
b69bb000-b6a66000 r--p 00000000 08:01 2638149 /usr/share/icons/Tangerine/icon-theme.cache
b6a66000-b6afe000 r--p 00000000 08:01 10895367 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
b6afe000-b6b00000 r-xp 00000000 08:01 2482321 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
b6b00000-b6b01000 r--p 00001000 08:01 2482321 /...

Read more...

Revision history for this message
Jan Claeys (janc) wrote :

This is a known limitation/bug in libparted (and supposedly in many other programs) which doesn't work with (hardware) sector sizes > 512 bytes.

Some explanations can be found when you look through the results of the following search on their mailing list:
http://www.mail-archive.com/search?q=jim%20meyering%20512&<email address hidden>

Changed in parted:
status: New → Confirmed
Revision history for this message
andso (andso) wrote :

from the duplicate https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/408971

thanks to Jan Claeys
I knew that's an hard job (H. Peter Anvin) to modify parted, but with my drive i discover that's an open door to the bug #1, and is the first limitation found in parted which is the best harddrive-tool.
I wanted to check the amazing work of frafa
http://forum.ubuntu-fr.org/viewtopic.php?id=276821
which use parted, and i have no issue at this time.

Vish (vish)
affects: hundredpapercuts → null
Revision history for this message
Jan Claeys (janc) wrote :

@andso: we know it's a serious issue, and this limitation of libparted is probably not an issue if all partitions start at the beginning of a sector; e.g. when the sector size is 2048 bytes and all partitions start at a multiple of 2048 bytes, it might work (I can't test that myself though, as I don't have such hardware).

It's also recommended to start partitions at the beginning of a sector for performance reasons, *but* if that's not true it should still work (and that's where it certainly fails currently).

Revision history for this message
Linus Hoppe (linus-hoppe-deactivatedaccount) wrote :

Can I hope to see this fixed in libparted?

Revision history for this message
andso (andso) wrote :

http://forum.ubuntu-fr.org/viewtopic.php?pid=3407953#p3407953
http://ubuntuforums.org/showthread.php?p=9130494#post9130494
for example in the ubuntu area

Many people can't install ubuntu (eg linux) on usb-hdd because parted fails.
That is a serious bug

I have tried with fdisk, cfdisk and nothing works on my Samsung S1

regards

Revision history for this message
andso (andso) wrote :

sorry
i have to try the daily build with parted 2.2

summary: - gparted crashes on startup
+ gparted doesn't support sector sizes > 512
Revision history for this message
Curtis Gedak (gedakc) wrote :

Support for disk devices with sectors sizes > 512 bytes is being worked on upstream.
https://bugzilla.gnome.org/show_bug.cgi?id=607165

Changed in gparted:
importance: Undecided → Unknown
status: New → Unknown
Changed in gparted:
status: Unknown → In Progress
Revision history for this message
Diego Liedo (diegoliedo) wrote :

I have the same problem in Ubuntu 9.10.
I was never able to use gparted while my external 4096 byte/sector usb drive was connected.
I went ahead and made the desired partitions using fdisk. After backing up a lot of data in that drive, I found out my drive was performing real slow writing.
I read that aligning the start sector to 64 solves the problem, but I did it with fdisk's defaults which led to an unnaligned slow drive.
It would be nice if gparted didn't crash every time I connect the drive.
I don't know what data to append so I'll wait for someone to ask.
Thanks.

Revision history for this message
Curtis Gedak (gedakc) wrote :

Diego, at the moment no additional information is required, at least from my perspective.

The problem with GParted crashing was avoided in version 0.5.1 by having GParted ignore devices with sector sizes > 512 bytes. See the following bug report for more details.
https://bugzilla.gnome.org/show_bug.cgi?id=595309

Support for these devices with sectors sizes > 512 bytes is being addressed under the following upstream bug report:
https://bugzilla.gnome.org/show_bug.cgi?id=607165

Revision history for this message
Jan Claeys (janc) wrote :

For those having this problem: I think partitioning should work correctly when using parted in "lucid" (Ubuntu 10.04). It's a commandline tool somewhat like fdisk or cfdisk, but AFAIK it will/can align partitions correctly.

(And as Curtis explained, for GParted, this is still worked on.)

Revision history for this message
Curtis Gedak (gedakc) wrote :

GParted 0.6.0 has just been released upstream. This new version includes support for devices with sector sizes greater than 512 bytes.

For more details refer to the following link:
http://gparted.sourceforge.net/news.php

Revision history for this message
andso (andso) wrote :

Thank's
i' have tried gparted-live-0.6.0-1.iso by virtualbox on an external usb drive Samsung S1 mini 120 Go - HXSU012BA and that' s ok (aligned on Mio).

Changed in gparted:
status: In Progress → Fix Released
Revision history for this message
Diego Liedo (diegoliedo) wrote :

I tested gparted 0.6.0 under ubuntu 10.04. It does recognize my 4096 byte/sector disk and allows to align to MB, however when attempting to write libparted 2.2 throws an error and stops detecting the device. I was trying to shrink a FAT32 (LBA) file system.
I'm attaching gparted's log but doesn't seem very useful.

Revision history for this message
Curtis Gedak (gedakc) wrote :

Diego, are you able to create new partitions with the FAT32 file system, and then resize these new partitions?

This answer would help to diagnose if the problem occurs for all FAT32 file systems on your disk device, or one specific file system.

As a side note, GParted uses the libparted library to resize FAT16, FAT32, HFS, and HFS+ file systems. This library has not seen much development work in the last while. The Parted (not GParted) team is focusing on partition editing operations only, and plans to deprecate many of the file system specific commands.

Revision history for this message
Diego Liedo (diegoliedo) wrote :

Curtis: I haven't tried creating a new partition on the disk using gparted. The only partition in the disk was created with fdisk and then formatted with mkfs.vfat. This is the one I can't resize. I hope this helps.

Revision history for this message
Curtis Gedak (gedakc) wrote :

From the log file I translated the following message from Spanish:

     No se puede detectar el sistema de ficheros.

to English:

     Can not detect file system.

Based on this message it would appear that the libparted library is unable to detect the FAT32 file system. This is not surprising since the Parted team is not planning to support file system operations and hence has not changed the code for FAT16/32 file system resizing. Unfortunately the only tools I know of to resize FAT16 and FAT32 file systems use libparted.

Revision history for this message
Colin Watson (cjwatson) wrote :

I just uploaded gparted 0.6.0-1ubuntu1 to maverick, including Curtis' upstream fixes for sector sizes > 512.

Changed in gparted (Ubuntu):
status: New → Fix Released
Revision history for this message
Curtis Gedak (gedakc) wrote :

My recommendation would be to use GParted 0.6.2. This is because GParted 0.6.0 contains two serious bugs that have been fixed in version 0.6.2.

The bugs present in GParted 0.6.0 are as follows:

Bug 623630 - Move logical partition to right yields invalid partition table on /dev/sda -- wrong signature 0
https://bugzilla.gnome.org/show_bug.cgi?id=623630

Bug 623697 - GParted crashes moving partitions when size is multiple of 16 MiB
https://bugzilla.gnome.org/show_bug.cgi?id=623697

Changed in gparted:
importance: Unknown → Medium
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.