Sunday, August 4, 2013

Mount Disk on Linux or MAC OS X

When I was new to linux I was unable to mount cd drives on command line interface. Some distributions of Graphical interface didn't mount it automatically. So here is information how we can do it easily.

First insert the cdrom. It generally appears in /dev/cdrom. If you cannot find it you can find it in /dev/disk/by-label/<cdrom label>
sudo -i 
This line promotes us to root. If this line is not executed, we have to type sudo in front of every command and might need to enter password every time.

Make sure that the folder where the cd is to be mounted (/mnt/cdrom in our case) is present. If not present type
mkdir -p /mnt/cdrom
The -p switch makes it sure that all folders get created if it does not exist.

For mounting, type following command to the prompt
mount <path to cd> <Path where it is to be mounted>
For an example
mount /dev/cdrom /mnt/cdrom

Now, the cd image is mounted to /mnt/cdrom. You can browse it by going to the folder /mnt/cdrom
cd /mnt/cdrom


No comments:

Post a Comment