0

I have two linux instances on amazon. Both of them have one disk device.

For test, I power off one instance (A) and attach its volume to the second one (B), as /dev/xvdf.

Into this server, I can mount and use (B), for example as /mount/xvdf.

Now the weirdness : I reboot this server (B) : sometimes it starts and I see its volume as / and the (B) volume as /mount/xvdf.

Sometimes (B) starts ... and I have the (B) volume as /!

This is the output of dmesg | grep xvd in this weird case:

[102029834.997373] blkfront: xvda1: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: disabled;
[102029835.000238] blkfront: xvdf: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: disabled;
[102029835.309885] EXT4-fs (xvdf): mounted filesystem with ordered data mode. Opts: (null)
[102029835.323719] EXT4-fs (xvdf): mounted filesystem with ordered data mode. Opts: (null)
[102029835.328251] dracut: Mounted root filesystem /dev/xvdf
[102029836.817661] EXT4-fs (xvdf): re-mounted. Opts: (null)

And this is cat /etc/fstab ... of volume (B) mounted as /:

LABEL=/
/           ext4    defaults,relatime  1   1 tmpfs
/dev/shm    tmpfs   defaults           0   0 devpts
/dev/pts    devpts  gid=5,mode=620     0   0 sysfs
/sys        sysfs   defaults           0   0 proc
/proc       proc    defaults           0   0

Is it possible I have a 'wrong' syntax in /etc/fstab so the system cannot discern which mount as /?

How to fix this caos ?

1
  • The line breaks in the quoted fstab are wrong. – Timothy Baldwin Jun 16 '19 at 9:52
0

Afaict the problem is you have two volumes with the same label. So which one ends up getting mounted by the initrd (dracut in your case) depends on which one the initrd code sees first.

Possible fixes include using device names instead of labels on the kernel command line or changing the partition labels on one of the systems.

1
  • how can I see the device uid ? instead of the kernel command line, isn't it sufficient to fix the mount of /dev/xvdf into /etc/fstab? – Massimo Jul 5 '17 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.