DevHeads.net

1404 server mounted the wrong drive

Hi all,

Our Ubuntu server has a ssd boot drive /dev/sda and mounts a 4tb drive
for owncloud. Funny thing is there is 2 4tb drives in the box /dev/sdb/
& /dev/sdc . Normally it loads the correct drive which is specified in
/etc/fstab by its uuid. This should be /dev/sdc. Yesterday after the
updates it mounted /dev/sdb. How could it suddenly mount the other hard
drive? It sort of cause panic due to files suddenly being old etc etc

Linux: 4.4.0-96-generic x86_64
Description: Ubuntu 14.04.5 LTS
Codename: trusty

yesterdays dmesg here <a href="http://www.philllfixit.com.au/dmesg.txt" title="http://www.philllfixit.com.au/dmesg.txt">http://www.philllfixit.com.au/dmesg.txt</a>

Comments

Re: 1404 server mounted the wrong drive

By Rashkae at 10/09/2017 - 22:13

On 17-10-09 10:09 PM, phil wrote:

Can you post a copy of your fstab file, and the output from sudo blkid

?

Re: 1404 server mounted the wrong drive

By Phil'll Fix It ... at 10/09/2017 - 22:25

On 10/10/2017 2:13 PM, Rashkae wrote:
Certainly, fstab didn't shed any light on it

phil@TARDIS[0]<0>:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=22789f51-59ae-4237-9c5a-0663b26aa928 / ext4
errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=12feb61e-2949-475a-a3b6-0df9febfc3d1 none swap sw
0 0
# bgdrv currently running on a 4Tb drive - should be /dev/sdc
UUID=04526e61-2c2c-433f-891e-f0ccbf2f2a0c /bgdrv ext4 rw
0 0
phil@TARDIS[0]<0>:~$

but blkid did

phil@TARDIS[0]<0>:~$ sudo blkid
[sudo] password for phil:
/dev/sda1: UUID="22789f51-59ae-4237-9c5a-0663b26aa928" TYPE="ext4"
/dev/sda5: UUID="12feb61e-2949-475a-a3b6-0df9febfc3d1" TYPE="swap"
/dev/sdb1: LABEL="bgdrv" UUID="04526e61-2c2c-433f-891e-f0ccbf2f2a0c"
TYPE="ext4"
/dev/sdc1: LABEL="bgdrv" UUID="04526e61-2c2c-433f-891e-f0ccbf2f2a0c"
TYPE="ext4"
phil@TARDIS[0]<0>:~$

The administrator of the server in question has rsynced one of the 4tb
drives to the other, hence the same uuid doh . . . Cheers for the
pointer Rashkae :)

Re: 1404 server mounted the wrong drive

By Rashkae at 10/09/2017 - 22:49

On 17-10-09 11:25 PM, phil wrote:

Unfortunately, no, he did not rsync... he did a block level copy,
(something like dd /dev/sdb /dev/sdc)

But easy to fix..sudo tune2fs -U random /dev/sdc (or /dev/sdb, whichever
is the old one.)

Re: 1404 server mounted the wrong drive

By Xen at 10/10/2017 - 00:39

Rashkae schreef op 10-10-2017 5:49:
But in that case there shouldn't have been old files anywhere.

But I'm not sure what calculates a FS uuid.... but anyway.

Re: 1404 server mounted the wrong drive

By Phil'll Fix It ... at 10/11/2017 - 03:24

On 10/10/2017 4:39 PM, Xen wrote:
For the sake of completeness the administrator did indeed dd the drives
but he did this about a month ago hence the older versions of files, he
has since updated the uuid as per Rashkaes tip above and everything
seems normal now. Thanks again :)

Re: 1404 server mounted the wrong drive

By Phil'll Fix It ... at 10/09/2017 - 22:56

On 10/10/2017 2:49 PM, Rashkae wrote:
Ahh ok many thanks :)