0

I was taking truability test to assess my skills. I got the below question.

Create a puppet manifest in /root/puppet/lad.pp to mount the filesystem located in /root/files/LAD/disk.ext2 that:

  • will mount the device at "/mnt/LAD"
  • sets fstab to prevent the filesystem from being fsck'd and will prevent dump from running on it
  • mounts the filesystem as ext2 via loopback device
  • mounts the filesystem as read-writable

I just started with puppet and I am not pretty sure if what I have is correct. I have the below file.

mount { "/mnt/LAD":
        device  => "/root/files/LAD/disk.ext2",
        fstype  => "ext2",
        ensure  => "mounted",
        options => "-o loop",
    }

When I run the above puppet configuration, I get the error as,

err: /Stage[main]//Mount[/mnt/LAD]: Could not evaluate: Execution of '/bin/mount -o -o 
loop /mnt/LAD' returned 1: [mntent]: line 13 in /etc/fstab is bad
mount: can't find /mnt/LAD in /etc/fstab or /etc/mtab

The following option works perfectly fine.

mount -o loop /root/files/LAD/disk.ext2 /mnt/LAD

Can someone point me where am doing wrong regarding the settings from puppet?

2
  • 1
    Try changing options => "-o loop", to options => "loop",? The error shows mount -o -o loop so you'd want to get rid of one of the -os.
    – Warwick
    Aug 20, 2014 at 0:50
  • Cool. Glad to be able to help.
    – Warwick
    Aug 20, 2014 at 1:01

1 Answer 1

1

Try changing

options => "-o loop",

to

options => "loop",

The error shows mount -o -o loop so you'd want to get rid of one of the -o arguments

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .