I want to mount .iso file after every booting of system. I know in centos-7 the /etc/rc.local file is not executable and need to change permission to run it like previous version.
But i have made the changes but still after booting the .iso file is not mounted.
Please advise.I have used the below command in rc.local file and make it executable. mount -o loop /media/xxx-xxx.iso /mnt/dvd
/etc/rc.local in CentOS 7
Re: /etc/rc.local in CentOS 7
Why would you not use /etc/fstab to do this? e.g.
Code: Select all
/media/xxx-xxx.iso /mnt/dvd nofail,loop,ro 0 0
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: /etc/rc.local in CentOS 7
The /etc/fstab is definitely the right spot.
I'd go a step towards fancy:
Rather than mount at boot, systemd generates a unit that will automount the image when something actually accesses /mnt/dvd.
With the timeout option there will be umount after 5 unused minutes (but automounter will remount on need again).
What is the actual type of the image? I did set "vfat" above. The fstab does require something on the fstype field.
I'd go a step towards fancy:
Code: Select all
/media/xxx-xxx.iso /mnt/dvd vfat ro,loop,nofail,noauto,x-systemd.automount,x-systemd.idle-timeout=300 0 0
With the timeout option there will be umount after 5 unused minutes (but automounter will remount on need again).
What is the actual type of the image? I did set "vfat" above. The fstab does require something on the fstype field.