Project

General

Profile

Actions

Bug #6085

closed

specify filetype flag (-t) when calling mount

Added by Alfredo Deza over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
ceph cli
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When not specifying the filetype `mount` will refuse to mount the filesystem created as seen in this thread from ceph-users:


>>> ceph-deploy disk zap ceph001:sdaa ceph001:sda1
>>>
>>>
>>>
>>> root@ceph001:~# parted /dev/sdaa print
>>>
>>> Model: ATA ST3000DM001-1CH1 (scsi)
>>>
>>> Disk /dev/sdaa: 3001GB
>>>
>>> Sector size (logical/physical): 512B/4096B
>>>
>>> Partition Table: gpt
>>>
>>>
>>>
>>> Number  Start  End  Size  File system  Name  Flags
>>>
>>>
>>>
>>> root@ceph001:~# parted /dev/sda1 print
>>>
>>> Model: Unknown (unknown)
>>>
>>> Disk /dev/sda1: 10.7GB
>>>
>>> Sector size (logical/physical): 512B/512B
>>>
>>> Partition Table: gpt
>>>
>>> So that is after running `disk zap`. What does it say after using
>>> ceph-deploy and failing?
>>>
>>>
>>>
>>> Number  Start  End  Size  File system  Name  Flags
>>>
>>>
>>>
>>> After ceph-disk -v prepare /dev/sdaa /dev/sda1:
>>>
>>>
>>>
>>> root@ceph001:~# parted /dev/sdaa print
>>>
>>> Model: ATA ST3000DM001-1CH1 (scsi)
>>>
>>> Disk /dev/sdaa: 3001GB
>>>
>>> Sector size (logical/physical): 512B/4096B
>>>
>>> Partition Table: gpt
>>>
>>>
>>>
>>> Number  Start   End     Size    File system  Name       Flags
>>>
>>> 1      1049kB  3001GB  3001GB  xfs          ceph data
>>>
>>>
>>>
>>> And
>>>
>>>
>>>
>>> root@ceph001:~# parted /dev/sda1 print
>>>
>>> Model: Unknown (unknown)
>>>
>>> Disk /dev/sda1: 10.7GB
>>>
>>> Sector size (logical/physical): 512B/512B
>>>
>>> Partition Table: gpt
>>>
>>>
>>>
>>> Number  Start  End  Size  File system  Name  Flags
>>>
>>>
>>>
>>> With the same errors:
>>>
>>>
>>>
>>> root@ceph001:~# ceph-disk -v prepare /dev/sdaa /dev/sda1
>>>
>>> DEBUG:ceph-disk:Journal /dev/sda1 is a partition
>>>
>>> WARNING:ceph-disk:OSD will not be hot-swappable if journal is not the
>>> same device as the osd data
>>>
>>> DEBUG:ceph-disk:Creating osd partition on /dev/sdaa
>>>
>>> Information: Moved requested sector from 34 to 2048 in
>>>
>>> order to align on 2048-sector boundaries.
>>>
>>> The operation has completed successfully.
>>>
>>> DEBUG:ceph-disk:Creating xfs fs on /dev/sdaa1
>>>
>>> meta-data=/dev/sdaa1             isize=2048   agcount=32, agsize=22892700
>>> blks
>>>
>>>          =                       sectsz=512   attr=2, projid32bit=0
>>>
>>> data     =                       bsize=4096   blocks=732566385, imaxpct=5
>>>
>>>          =                       sunit=0      swidth=0 blks
>>>
>>> naming   =version 2              bsize=4096   ascii-ci=0
>>>
>>> log      =internal log           bsize=4096   blocks=357698, version=2
>>>
>>>          =                       sectsz=512   sunit=0 blks, lazy-count=1
>>>
>>> realtime =none                   extsz=4096   blocks=0, rtextents=0
>>>
>>> DEBUG:ceph-disk:Mounting /dev/sdaa1 on /var/lib/ceph/tmp/mnt.UkJbwx
>>> with options noatime
>>>
>>> mount: /dev/sdaa1: more filesystems detected. This should not happen,
>>>
>>>        use -t <type> to explicitly specify the filesystem type or
>>>
>>>        use wipefs(8) to clean up the device.
>>>
>>>
>>>
>>> mount: you must specify the filesystem type
>>>
>>> ceph-disk: Mounting filesystem failed: Command '['mount', '-o',
>>> 'noatime', '--', '/dev/sdaa1', '/var/lib/ceph/tmp/mnt.UkJbwx']'
>>> returned non-zero exit status 32

After applying a patch and passing the `-t` flag the filesystem mounted correctly.

Actions #1

Updated by Alfredo Deza over 10 years ago

  • Description updated (diff)

This is the actual patch that fixes this problem:

diff --git a/src/ceph-disk b/src/ceph-disk
index 77a9d9a..c94d370 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -671,6 +671,7 @@ def mount(
         subprocess.check_call(
             args=[
                 'mount',
+                '-t', fstype,
                 '-o', options,
                 '--',
                 dev,
Actions #2

Updated by Alfredo Deza over 10 years ago

  • Status changed from 12 to Fix Under Review
Actions #3

Updated by Sage Weil over 10 years ago

  • Status changed from Fix Under Review to Resolved
  • Source changed from other to Community (user)
Actions

Also available in: Atom PDF