0

I am using a loop file system because I do not have another partition to mount and I am only practicing as I study for my sysadmin exam. I added the following line to my stab

/tmp/imagefile        mnt/tempdir     ext4    defaults        0 0

— this was done after creating a 1 mb file using the dd command and successfully mounting it manually using the mount command. However when I added this line to fstab and rebooted it restarted into emergency mode. I was able to edit the file in emergency mode and removing the line allowed a normal reboot. This happened on two systems a centos 7 system and a fedora 20 system.

200_success
  • 4,701
  • 1
  • 24
  • 42
RGB
  • 3
  • 3

1 Answers1

0

For a loopback mount, you would want to invoke mount with -o loop, so change defaults to loop.

Also, give an absolute path to /mnt/tempdir.

After editing fstab, verify that you can run mount /mnt/tempdir, and if so, it should work on the next boot.

200_success
  • 4,701
  • 1
  • 24
  • 42
  • made changes, same result, looked at journalctl and noticed in could not find imagefile and noticed it was not there. Maybe Fedora is removing it because it is in the tmp directory. – RGB Sep 01 '15 at 20:48
  • As mentioned in the comment, stuff in /tmp is assumed to be completely disposable. /var/tmp is for temporary stuff that requires persistence. But even using /var/tmp would be weird. – 200_success Sep 01 '15 at 20:50