[systemd-devel] How to handle loop mounts?

Mike Kazantsev mk.fraggod at gmail.com
Wed Aug 8 05:24:59 PDT 2012


On Tue, 07 Aug 2012 18:13:46 -0400
Eelco Dolstra <eelco.dolstra at logicblox.com> wrote:

> Hi,
> 
> I have an /etc/fstab that contains the following line:
> 
>   /disk1.img /disk1 ext4 loop 0 2
> 
> where /disk1.img is a regular file containing an ext4 filesystem.  Systemd fails
> to mount /disk1 if I run "systemctl start disk1.mount":
> 
...

Same thing seem to work here:

  dd if=/dev/zero of=looptest bs=1M count=100 
  losetup /dev/loop0 looptest
  mkfs.ext4 /dev/loop0
  losetup -D
  echo '/root/looptest /mnt/tmp ext4 loop' >>/etc/fstab
  mount /mnt/tmp
  systemctl status mnt-tmp.mount
  mnt-tmp.mount - /mnt/tmp
          Loaded: loaded
          Active: active (mounted) since Wed, 08 Aug 2012 18:21:04 +0600; 5s ago
           Where: /mnt/tmp
            What: /dev/loop0
          CGroup: name=systemd:/system/mnt-tmp.mount

Maybe you have older systemd version (186 here), or your setup is more
complicated than that (haven't tested crypttab, but you seem to imply
that above doesn't work as well)?


-- 
Mike Kazantsev // fraggod.net


More information about the systemd-devel mailing list