Mounting storage volume - wrong fs type, bad option, bad superblock on ..

1,015 views
Skip to first unread message

Maiken Pedersen

unread,
Jan 8, 2018, 10:07:24 AM1/8/18
to elasticluster
This is not really related to elasticluster, but kind of since I need to attach storage volumes for my cluster.
So maybe people here have some tips anyway.


In my private ansible script I do:

- name: Ensure directories exist
  file:
    path: "{{ item.path }}"
    state: directory
    owner: "{{ user_name_grid }}"
    group: "{{ group_name_grid }}"
    mode: 0755
  with_items: "{{ blockstorage }}"

- name: Add mountpoints in fstab
  mount:
    fstype: "{{ item.fstype }}"
    path: "{{ item.path }}"
    src: "{{ item.src }}"
    state: mounted
  with_items: "{{ blockstorage }}"

And I have variables (in /roles/frontend/vars/main.yml)
blockstorage:
  - path: '/wlcg'
    src: '/dev/sdb'
    fstype: 'ext4'
  - path: '/grid'
    src: '/dev/sdc'
    fstype: 'ext4'


TASK [frontend : Ensure directories exist] *******************************************************************************************************************************************************************************************
ok: [frontend001] => (item={u'path': u'/wlcg', u'src': u'/dev/sdb', u'fstype': u'ext4'}) => {"changed": false, "gid": 500, "group": "centos", "item": {"fstype": "ext4", "path": "/wlcg", "src": "/dev/sdb"}, "mode": "0755", "owner": "centos", "path": "/wlcg", "secontext": "unconfined_u:object_r:default_t:s0", "size": 4096, "state": "directory", "uid": 500}
ok: [frontend001] => (item={u'path': u'/grid', u'src': u'/dev/sdc', u'fstype': u'ext4'}) => {"changed": false, "gid": 500, "group": "centos", "item": {"fstype": "ext4", "path": "/grid", "src": "/dev/sdc"}, "mode": "0755", "owner": "centos", "path": "/grid", "secontext": "unconfined_u:object_r:default_t:s0", "size": 4096, "state": "directory", "uid": 500}

TASK [frontend : Add mountpoints in fstab] *******************************************************************************************************************************************************************************************
changed: [frontend001] => (item={u'path': u'/wlcg', u'src': u'/dev/sdb', u'fstype': u'ext4'}) => {"changed": true, "dump": "0", "fstab": "/etc/fstab", "fstype": "ext4", "item": {"fstype": "ext4", "path": "/wlcg", "src": "/dev/sdb"}, "name": "/wlcg", "opts": "defaults", "passno": "0", "src": "/dev/sdb"}
failed: [frontend001] (item={u'path': u'/grid', u'src': u'/dev/sdc', u'fstype': u'ext4'}) => {"failed": true, "item": {"fstype": "ext4", "path": "/grid", "src": "/dev/sdc"}, "msg": "Error mounting /grid: mount: wrong fs type, bad option, bad superblock on /dev/sdc,\n       missing codepage or helper program, or other error\n       In some cases useful info is found in syslog - try\n       dmesg | tail  or so\n\n"}
    to retry, use: --limit @/home/centos/grid-uh-cloud/ansible/grid_cluster_setup/frontend.retry

Why do I get this failure? I can loginto the machine and perform the ext4 and mount commands by hand. But I would of course like to avoid that.

Maiken

Riccardo Murri

unread,
Jan 8, 2018, 10:12:11 AM1/8/18
to Maiken Pedersen, elasticluster
(Maiken Pedersen, Mon, Jan 08, 2018 at 07:07:24AM -0800:)
> Why do I get this failure? I can loginto the machine and perform the ext4
> and mount commands by hand. But I would of course like to avoid that.

Have you formatted the block devices (`mkfs.ext4 /dev/whatever`) before
mounting? As far as I can see, OpenStack provisions "raw" devices as
volumes.

The Ansible "filesystem" module may help you with this:
http://docs.ansible.com/ansible/latest/filesystem_module.html

Ciao,
R

--
Riccardo Murri / Email: riccard...@gmail.com / Tel.: +41 77 458 98 32

Maiken Pedersen

unread,
Jan 8, 2018, 10:13:13 AM1/8/18
to elasticluster
Strange thing is that it succeeds mounting the first, but not the last. When I earlier only wanted to create and mount one volume it failed with that one right at once.

[centos@frontend001 ~]$ dmesg | tail
sd 2:0:0:2: Attached scsi generic sg2 type 0
sd 2:0:0:2: [sdc] 41943040 512-byte logical blocks: (21.4 GB/20.0 GiB)
sd 2:0:0:2: [sdc] Write Protect is off
sd 2:0:0:2: [sdc] Mode Sense: 63 00 00 08
sd 2:0:0:2: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdc: unknown partition table
sd 2:0:0:2: [sdc] Attached SCSI disk
EXT4-fs (sdb): mounted filesystem with ordered data mode. Opts:
SELinux: initialized (dev sdb, type ext4), uses xattr
EXT4-fs (sdc): VFS: Can't find ext4 filesystem
[centos@frontend001 ~]$ lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda      8:0    0  20G  0 disk
`-sda1   8:1    0   8G  0 part /
sdb      8:16   0  10G  0 disk /wlcg
sdc      8:32   0  20G  0 disk

Riccardo Murri

unread,
Jan 8, 2018, 10:30:48 AM1/8/18
to Maiken Pedersen, elasticluster
Well, the kernel message is quite explicit:

> EXT4-fs (sdc): VFS: Can't find ext4 filesystem

Maybe you started the volume mounted on `/dev/vdb` from a snapshot? (So
it's already formatted) You can check that by running `file -s /dev/XXX`
Example::

$ sudo file -s /dev/nvme0n1p3
/dev/nvme0n1p3: Linux rev 1.0 ext4 filesystem data, UUID=217cd1cc-9ebe-4708-a4c8-23a0698eb9d1 (needs journal recovery) (extents) (64bit) (large files) (huge files)

I would still recommend that you just add an Ansible "filesystem" stanza
before trying to mount the filesystem.

Maiken Pedersen

unread,
Jan 8, 2018, 10:33:03 AM1/8/18
to elasticluster
Ah, good point. I actually thought the mount module did that. Thanks ever so much, and sorry for the noise!!
Reply all
Reply to author
Forward
0 new messages