Wednesday, July 17, 2013

MountUnmount Devices in Linux

Mount Unmount devices in Linux

MOUNTING / UMOUNTING
Some important files for mounting in linux

/etc/mtab           Contains a list of all currently mounted file systems
/etc/fstab           Mounts all listed file systems with given options at
                          boot time
Go through the /etc/fstab file. The file follows this syntax:

/dev/mapper/vg_root         /                        ext4            defaults       
 <device>                      <mount point> <file system>   <mount options>


           1                                         1
<write data during shutdown> <check sequence>

Let’s label the file system CData to denote that it’s the company data file system:

# e2label /dev/hdb1 CData

To find the file system you just labeled:
# findfs LABEL=CData

To check the file system:
# e2fsck -f /dev/vg_group01/lvol0

If you want to mount removable media like as CD/DVD and USB
it may take any of below device depnd on your interface type

#mount /dev/cdrom  /mountdirectory
#mount /dev/sr1    /mountdirectory
#mount /dev/sr0    /mountdirectory


NOTE: by default there are two empty directory in linux is allready created that you you can
use as a mounting directory named as /mnt and /media

No comments:

Post a Comment