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 769831 - Formatting a partition on a BSD table fails at step: set partition type
Formatting a partition on a BSD table fails at step: set partition type
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
0.25.0
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2016-08-13 12:30 UTC by Timo Riikonen
Modified: 2016-10-08 11:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Gparted screenshot (51.78 KB, image/png)
2016-08-13 13:50 UTC, Timo Riikonen
Details
Info after GPT (11.55 KB, image/png)
2016-08-13 15:40 UTC, Timo Riikonen
Details

Description Timo Riikonen 2016-08-13 12:30:33 UTC
I am running Kubuntu.
I tried to format a new SSD (Solid State Drive) disk as ext4 and fat32 but they both failed. Here is the log from the latter:
GParted 0.25.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2

Format /dev/sdb1 as fat32  00:00:00    ( ERROR )
    	
calibrate /dev/sdb1  00:00:00    ( SUCCESS )
    	
path: /dev/sdb1 (partition)
start: 2048
end: 250068991
size: 250066944 (119.24 GiB)
clear old file system signatures in /dev/sdb1  00:00:00    ( SUCCESS )
    	
write 512.00 KiB of zeros at byte offset 0  00:00:00    ( SUCCESS )
write 4.00 KiB of zeros at byte offset 67108864  00:00:00    ( SUCCESS )
write 512.00 KiB of zeros at byte offset 128033751040  00:00:00    ( SUCCESS )
write 4.00 KiB of zeros at byte offset 128034209792  00:00:00    ( SUCCESS )
write 8.00 KiB of zeros at byte offset 128034267136  00:00:00    ( SUCCESS )
flush operating system cache of /dev/sdb  00:00:00    ( SUCCESS )
set partition type on /dev/sdb1  00:00:00    ( ERROR )
========================================

After that I executed this mkfs command with success:
timo@kubuntu-acer:~$ sudo mkfs.ext4 -L "" /dev/sdb1
[sudo] password for timo: 
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 31258368 4k blocks and 7815168 inodes
Filesystem UUID: 1576a8cd-7721-48c5-8b71-2fdb57b4e8ac
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

gparted program refreshed itself automatically and detected the ext4 formatting correctly.
Comment 1 Timo Riikonen 2016-08-13 12:34:43 UTC
And the hardware was:
SanDisk 119GiB IDE.
I have made it external by setting it into an external deck for two large or small IDE drives. This docker (?) has copy feature also where B drive needs to be same size or bigger than A drive.
Comment 2 Mike Fleetwood 2016-08-13 13:28:36 UTC
Hello Timo,

Using an SSD should not be making any difference.  At the point when
GParted is logging:
    set partition type on /dev/sdb1
it is making a libparted API call to set the type of the partition
appropriately for the FAT32 file system it is about to be created.

Did you get any error dialogs from GParted?
Please attach a screen shot of GParted main page with View > Device
Information ticketed and /dev/sdb device chosen.

Thanks,
Mike
Comment 3 Timo Riikonen 2016-08-13 13:50:53 UTC
Created attachment 333222 [details]
Gparted screenshot
Comment 4 Timo Riikonen 2016-08-13 13:53:17 UTC
(In reply to Timo Riikonen from comment #3)
> Created attachment 333222 [details]
> Gparted screenshot

There was no indication for the error reason. It told me to check from a web page as to how to log the bug.
Comment 5 Mike Fleetwood 2016-08-13 14:01:45 UTC
I have re-produced the error.  It is because BSD partition table is
being used.  I will look into this bug.

Timo,

Is there a reason you need to use the BSD partition table?
If not I recommend you use either MSDOS or GPT as these are much more
popular and will work successfully with GParted.

Thanks,
Mike
Comment 6 Timo Riikonen 2016-08-13 15:24:58 UTC
I have just used ext4 for the last 20 years and didn't know of any better. 
Need to transfer to using GPT then.

P.S. fat32 failed in gpart as well.
Comment 7 Timo Riikonen 2016-08-13 15:32:51 UTC
Ah, GPT is not on the list of format options. 
Does it have some other name?
Comment 8 Timo Riikonen 2016-08-13 15:40:44 UTC
Created attachment 333238 [details]
Info after GPT

After I created GPT partition table I am unable to format it with gparted.
Comment 9 Timo Riikonen 2016-08-13 15:41:43 UTC
Never mind... I got it. 
Can't remove my stupid comments :(
Comment 10 Mike Fleetwood 2016-08-15 21:42:31 UTC
Updated summary to reflect the actual issue.

Found that GParted was requesting libparted to set the LVM flag on a
partition on a BSD table reports failure.
    ped_partition__set_flag(lp_ptn, PED_PARTITON_LVM, state)
returns 0 (failure) even though PED_PARTITION_LVM is an available flag
for partitions on BSD tables.  This is a bug in libparted.
Comment 11 Mike Fleetwood 2016-08-16 20:15:53 UTC
I've submitted a parted patchset to resolve this bug.

[PATCH 0/8] Fix to report success when setting lvm flag on bsd table
http://lists.alioth.debian.org/pipermail/parted-devel/2016-August/004885.html
Comment 12 Mike Fleetwood 2016-10-08 11:53:15 UTC
My patchset has been included in parted (libparted) for a future
release.  Here's the crucial fix:

libparted: Fix to report success when setting lvm flag on bsd table
http://git.savannah.gnu.org/cgit/parted.git/commit/?id=abc97eaf92f5ce6e30893e355a74159e5827f654

Closing this bug report now as we have no idea when parted will make a
new release.