partman: mkfs.xfs: error - cannot set blocksize 512 on block device /dev/dasda1: Invalid argument

Bug #1544574 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xfsprogs (Ubuntu)
Fix Released
Undecided
Dimitri John Ledkov

Bug Description

== Comment: #0 - Gerhard G. Hiller <email address hidden> - 2016-02-11 09:03:39 ==
Installer version 20101020ubuntu421
Started installation and tried to create xfs partition on DASD (blocksize 4096).
Partman returned with error: partman: mkfs.xfs: error - cannot set blocksize 512 on block device /dev/dasda1: Invalid argument
Attaching syslog, partman, and hardware-summary.

Revision history for this message
bugproxy (bugproxy) wrote : syslog
  • syslog Edit (65.3 KiB, application/octet-stream)

Default Comment by Bridge

tags: added: architecture-s39064 bugnameltc-136950 severity-critical targetmilestone-inin1604
Revision history for this message
bugproxy (bugproxy) wrote : partman log

Default Comment by Bridge

Revision history for this message
bugproxy (bugproxy) wrote : details on hardware summary

Default Comment by Bridge

Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2016-02-11 09:53 EDT-------
The DASD device does not accept block sizes that are smaller than the block size with which the DASD has been low-level formatted. That means that for a 4K low-level format, you have to use 4K block size of the file system at a minimum.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2016-02-11 10:14 EDT-------
partman uses obviously and erroneously a method with 512 byte block size (like on SCSI disks) to create an xfs filesystem. This method needs to be adjusted for ECKD DASDs, since they have usually a block size of 4096 bytes. (In very rare cases, DASDs can be dasdformatted with 2048 or 1024 or 512 bytes blocksize, but it doesn't make sense and wastes space.)
I didn't have a look into the partman code, but it looks like the libparted underneath uses a default blocksize for xfs of 512 where it should use 4096 (for ECKD DASDs, not for SCSI LUNs!). But that's just an assumption.

dann frazier (dannf)
affects: ubuntu → debian-installer (Ubuntu)
Changed in debian-installer (Ubuntu):
assignee: Skipper Bug Screeners (skipper-screen-team) → Dimitri John Ledkov (xnox)
affects: debian-installer (Ubuntu) → xfsprogs (Ubuntu)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Parted is not used to create xfs filesystem. The call chain is d-i -> partman -> partman-xfs -> mkfs.xfs, thus xfsprogs is used.

It defaults to XFS_DFL_BLOCKSIZE_LOG 12, that is 2**12 = 4096, i.e. 4k block size.

Looking at the syslog, however, it shows that BLKBSZSET ioctl is called with 512 value...

Digging further, there are two code paths in mkfs.xfs, one with blkid probes and another one without, which simply uses hard-coded 512 value. Checking xfsprogs build-log it appears that d-i version of mkfs.xfs is built without blkid support

"""
    [CC] xfs_mkfs.o
gcc -g -O2 -Os -DNDEBUG -DVERSION=\"4.3.0\" -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"xfsprogs\" -I../include -I../libxfs -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -DHAVE_MNTENT -c xfs_mkfs.c
xfs_mkfs.c:465:4: warning: #warning BLKID is disabled, so signature detection and block device access are not working! [-Wcpp]
 # warning BLKID is disabled, so signature detection and block device\
    ^
    [LD] mkfs.xfs
"""

I think two things should happen. In non-blkid case xfs is really ought to default to 4096, as per manpages.
And secondly, d-i built should come with blkid support enabled on Ubuntu, as really, anything else is not acceptable.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

11542# Check whether --enable-blkid was given.
11543if test "${enable_blkid+set}" = set; then :
11544 enableval=$enable_blkid;
11545else
11546 enable_blkid=yes
11547fi

looks like autoconf is buggy, and if one specifies --enable-blkid, or enable-blkid=yes (as done in debian/rules) the net effect is to _disable_ blkid support...

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xfsprogs - 4.3.0+nmu1ubuntu1

---------------
xfsprogs (4.3.0+nmu1ubuntu1) xenial; urgency=medium

  * Enable blkid in d-i, by dropping explicitly passed configure option
    (broken configure). (LP: #1544574).
  * Drop trying to create upstream distribution.

 -- Dimitri John Ledkov <email address hidden> Tue, 16 Feb 2016 00:20:02 +0000

Changed in xfsprogs (Ubuntu):
status: New → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2016-02-25 08:22 EDT-------
successfully verified with version 4.3.0+nmu1ubuntu1.

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

Other bug subscribers

Remote bug watches

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