#57 support -o remount in mount.crypt

pam_mount
closed-fixed
pam_mount (94)
5
2009-04-14
2009-03-26
Till Maas
No

It seems that mount -o remount does not work with mount.crypt mounted crypto devices currently. I guess mount.crypt should check whether remount is given as option and in this case skip the devicemapper creation part and only do the remount for the device mapper device that contains the actual filesystem.

Fedora bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=492347

Discussion

  • Jan Engelhardt

    Jan Engelhardt - 2009-03-31
    • milestone: 164970 -->
    • labels: 379076 -->
    • status: open --> open-accepted
     
  • Jan Engelhardt

    Jan Engelhardt - 2009-03-31
    • status: open-accepted --> pending-fixed
     
  • Jan Engelhardt

    Jan Engelhardt - 2009-03-31

    In v1.21-2-g571cfc2. Ok to release?

     
  • Nobody/Anonymous

    Something is not right, yet.
    Bug1:
    /etc/mtab is wrong. I am not sure, whether this was different before.

    # mount -o ro image2 mnt2
    Password:
    key slot 0 unlocked.
    Command successful.
    [root@leela pam_mount-test]# mount | grep mnt2
    /home/testor/pam_mount-test/image2 on /home/testor/pam_mount-test/mnt2 type crypt (defaults)
    [root@leela pam_mount-test]# grep mnt2 /proc/mounts
    /dev/mapper/_home_testor_pam_mount_test_image2 /home/testor/pam_mount-test/mnt2 ext3 ro,relatime,errors=continue,data=ordered 0 0

    After "mount -o remount image2", /etc/mtab or mount correctly show ro as mount option.

    Bug 2&3:
    It is not possible to come back from ro to rw. Also after using acl in the remount, every remount after then, the occurences of acl are doubled:

    [root@leela pam_mount-test]# mount -o ro image mnt
    Password:
    key slot 0 unlocked.
    Command successful.
    [root@leela pam_mount-test]# mount | grep mnt
    /home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (defaults)
    [root@leela pam_mount-test]# mount -o remount,acl mnt
    mount: blockorientiertes Gerät /home/testor/pam_mount-test/image ist schreibgeschützt, wird eingehängt im Nur-Lese-Modus
    [root@leela pam_mount-test]# mount | grep mnt
    /home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (ro,acl)
    [root@leela pam_mount-test]# mount -o remount,rw mnt
    mount: blockorientiertes Gerät /home/testor/pam_mount-test/image ist schreibgeschützt, wird eingehängt im Nur-Lese-Modus
    [root@leela pam_mount-test]# mount | grep mnt
    /home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (ro,acl,acl)

     
  • Jan Engelhardt

    Jan Engelhardt - 2009-04-03

    Since you passed in -o ro with the initial mount command, the loop device is set up as read-only, as is the cryptsetup device, as is the mount. Since remount would not touch loop or crypto devices, the mount cannot be switched to rw. Unfortunately, I cannot run "cryptsetup change" without providing all the cipher etc options again — which are not available at remount time. Similar applies to losetup; while we do have the necessary info, losetup knows no way to switch from ro to rw or vice-versa without destroying the loop device.

     
  • Jan Engelhardt

    Jan Engelhardt - 2009-04-03
    • status: pending-fixed --> pending
     
  • Till Maas

    Till Maas - 2009-04-13

    I attached a patch for Bug 1 I noticed here, which makes mount.crypt write "ro" instead of "defaults" in /etc/mtab, if it was specified the first time.

    Nevertheless with current git I still see this cosmetic bug:
    [root@leela pam_mount-test]# mount image mnt
    Password:
    key slot 0 unlocked.
    Command successful.
    [root@leela pam_mount-test]# mount | grep image
    /home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw)
    [root@leela pam_mount-test]# mount -o remount,acl mnt
    [root@leela pam_mount-test]# mount | grep image
    /home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw,acl)
    [root@leela pam_mount-test]# mount -o remount mnt
    [root@leela pam_mount-test]# mount | grep image
    /home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw,acl,acl)
    [root@leela pam_mount-test]# mount -o remount mnt
    [root@leela pam_mount-test]# mount | grep image
    /home/testor/pam_mount-test/image on /home/testor/pam_mount-test/mnt type crypt (rw,acl,acl,acl,acl)

     
  • Till Maas

    Till Maas - 2009-04-13
    • status: pending --> open
     
  • Jan Engelhardt

    Jan Engelhardt - 2009-04-14

    Applied.

    >Nevertheless with current git I still see this cosmetic bug:

    This is a bug of mount(8). You can notice it outside pam_mount too:
    mount -i /foo -o remount,acl,acl,acl
    mount -i /foo -o remount,acl,acl,acl
    and you will have at least 6 acl options in /etc/mtab.

     
  • Jan Engelhardt

    Jan Engelhardt - 2009-04-14
    • status: open --> closed-fixed
     
  • Jan Engelhardt

    Jan Engelhardt - 2009-04-14
    • milestone: --> pam_mount
    • labels: --> pam_mount
     

Log in to post a comment.