[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mount inconsistencies



On Mon, 12 May 2014 17:52:44 +0200
Jochen Spieker <ml@well-adjusted.de> wrote:

> Hi folks,
> 
> this looks very weird to me. My wheezy system claims that a filesystem
> is mounted, but the mount directory appears to be empty and umount
> fails because the filesystems is not mounted, after all:
> 
> | # grep backup /etc/fstab
> | /dev/mapper/backup-decrypted  /srv/backup  ext4
> noatime,nodiratime,barrier=1,noauto,nodelalloc  0 0 | 
> | # mount | grep backup
> | /dev/mapper/backup-decrypted on /srv/backup type ext4
> (rw,noatime,nodiratime,nodelalloc,data=ordered) | 
> | # df -h /srv/backup/
> | Filesystem                    Size  Used Avail Use% Mounted on
> | /dev/mapper/backup-decrypted  2.5T  1.8T  699G  72% /srv/backup
> | 
> | # ls -la /srv/backup/
> | total 8
> | drwxr-xr-x  2 root root 4096 Oct 21  2011 ./
> | drwxr-xr-x 11 root root 4096 Oct 22  2013 ../
> | 
> | # umount /srv/backup
> | umount: /srv/backup: not mounted
> 
> I don't think it's important, but the filesystem is encrypted using
> LUKS on top of an LVM volume:
> 
> | # grep backup /etc/crypttab
> | backup-decrypted        /dev/mapper/backup2-lvol0
> none                    noauto,luks,cipher=aes-cbc-plain:sha256
> 
> Interestingly, when I mount /srv/backup again, I can see its contents
> and umount it afterwards. But only once. Complete transcript:
> 
> | # mount /srv/backup/
> | 
> | # ls /srv/backup/
> | abattoir/  abattoir-winxp/  cupcake/  jigsaw/  lost+found/  mail/
> manowar/  _manual/  xenhost/ | 
> | # mount | grep backup
> | /dev/mapper/backup-decrypted on /srv/backup type ext4
> (rw,noatime,nodiratime,nodelalloc,data=ordered)
> | /dev/mapper/backup-decrypted on /srv/backup type ext4
> (rw,noatime,nodiratime,nodelalloc,data=ordered) | | #
> umount /srv/backup | 
> | # umount /srv/backup
> | umount: /srv/backup: not mounted
> 
> Do you have any ideas what's wrong?
> 
> Regards,
> J.

No. :-(

But I do have some thoughts.

First, if you're not unmounting /srv/backup as root, try doing so.

Next, before /dev/mapper/backup-decrypted can exist, something
(cryptsetup luksOpen) must create it. Look for that, in /etc/fstab and
elsewhere.

Also, something somewhere must input the LUKS filesystem's password.

As a reference, here's my shellscript for mounting an encrypted Blu-Ray:

==================================================
#!/bin/bash

discdev=/dev/sr0       #change as needed for system
udfmountpoint=/mnt/test
mapperdev=udf

udfloop=`sudo losetup -f`

sudo losetup $udfloop $discdev
sudo cryptsetup luksOpen $udfloop $mapperdev
sudo mount /dev/mapper/$mapperdev $udfmountpoint
echo Encrypted loop device is at /dev/mapper/$mapperdev or $udfloop.
echo Read files from $udfmountpoint
==================================================

When ready to unmount the disc, I work backwards, all as root or using
sudo:

* Unmount the disc from the mapper device.
* Eject the disc.
* use cryptsetup luksClose to close the encrypted device.
* Use losetup -d to delete the loopback device.

HTH,

SteveT

Steve Litt                *  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Reply to: