Bug 978302
| Summary: | mke2fs-J should give a meaningful error when specified type is anything except 'ext{2,3,4}' | ||
|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Richard W.M. Jones <rjones> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | CLOSED UPSTREAM | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | unspecified | CC: | bfan, dyasny, leiwang, mbooth, qguan, wshi |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 976299 | Environment: | |
| Last Closed: | 2013-06-26 15:18:37 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 976299 | ||
|
Description
Richard W.M. Jones
2013-06-26 10:14:05 UTC
So the problem here is that we use the -F option to force mke2fs not to ask any questions. However it has the unfortunate side-effect of making mke2fs also ignore bad -t xfs argument. In virt-rescue: ><rescue> mke2fs -t xfs -b 4096 -J device=/dev/sdb /dev/sda mke2fs 1.42.5 (29-Jul-2012) /dev/sda is entire device, not just one partition! Proceed anyway? (y,n) y Your mke2fs.conf file does not define the xfs filesystem type. Aborting... vs: ><rescue> mke2fs -F -t xfs -b 4096 -J device=/dev/sdb /dev/sda mke2fs 1.42.5 (29-Jul-2012) Your mke2fs.conf file does not define the xfs filesystem type. Discarding device blocks: done Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 655360 inodes, 2621440 blocks 131072 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2684354560 80 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Allocating group tables: done Writing inode tables: done Adding journal to device /dev/sdb: done Writing superblocks and filesystem accounting information: done The second command creates an ext3 filesystem. So this is a bug in mke2fs -F option. Note it also affects the mke2fs API, if you use the forcecreate argument (which causes -F to be passed to mke2fs). eg: ><fs> mke2fs /dev/sda1 fstype:xfs forcecreate:true [no error] but: ><fs> mke2fs /dev/sda1 fstype:xfs forcecreate:false libguestfs: error: mke2fs: /dev/sda1: mke2fs 1.42.5 (29-Jul-2012) Anyhow I think the way I'm actually going to solve this is by filtering the types allowed so they must match /^ext[234]$/. The reason is at the moment we also allow types from the /etc/mke2fs.conf file, such as "floppy" or "big" which aren't supportable in a stable API such as libguestfs. |