1

I ran this command on RHEL 6.3:

# mount /dev/cdrom /mnt

Everything is okay, but after a restart the mounted dir, /mnt disappears... I don't know where is it going.

  • man mount If you don't understand why a program isn't doing what you expect, try reading the man page before asking a question that makes it look like you didn't make any effort to solve your own problem. – Don Simon Dec 24 '15 at 18:01
  • @DonSimon Man pages are great if you know what you're looking for, but they aren't great how-to guide for neophyte users. I already know an answer to his question, but it's not at all obvious from mount's man page that it is the right answer, this is far from clear: The file /etc/fstab (see fstab(5)), may contain lines describing what devices are usually mounted where, using which options. Even the fstab man page doesn't make it clear that it describes filesystems mounted upon boot. For a cdrom drive he might also be better served by some sort of automounter. – Johnny Dec 24 '15 at 20:27
  • I couldn't disagree more. If you don't take the time to learn how to use man pages, you will never get better, and will keep asking easily self-answered questions. The site is not served well by people who keep asking the same basic questions that are already well documented. – Don Simon Dec 28 '15 at 16:33
3

Because when you boot up, nothing is mounted yet and each filesystem must be mounted in turn. The list of filesystems that should be automatically mounted during boot is in /etc/fstab so if you want your cdrom to be mounted automatically on each boot, you must add a line for it to that file.

2

Mount doesn't permanently mount the file. To do that, you must edit your /etc/fstab file. man fstab will give you all the documentation you need.

0

just add this entry to /etc/fstab file :

    /dev/cdrom         /mnt/cdrom            iso9660        ro                0   0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.