Sunday, November 11, 2007

mount, umount and ln -s

sudo mkdir /media/eagle
sudo mount /dev/sdb2 /media/eagle

For automatically mount, edit /etc/fstab
sudo vim /etc/fstab
Add the follow line the the end of fstab file:
/dev/sda2 /media/eagle ext3 defaults 1 2

Example:

/etc/fstab

automount

Being able to mount filesystems manually is all well and good. But I want to mount a whole bunch of filesystems at boot up time. To do that, I set up /etc/fstab with a descriptions of all my filesystems that are to be automounted.

/etc/fstab has a simple format. One filesystem per line, 6 columns per line, separated by white space. The first four columns are the same information you type in when using mount manually.

  • first column - the device to mount
  • second column - the mount point
  • third column - the filesystem type
  • fourth column - options (-o)

The last two columns contain two numbers.

  • fifth column - which filesystems need to be dumped, that is - backed up with the dump utility. As Slackware no longer comes with the dump backup utility, you can safely ignore this column. The Slackware installation sets this column to 1 for non-removable real filesystems. I've just left it as is.
    • 0 = does not need to be backed up with dump
    • 1 = needs to be backed up with dump
  • sixth column - used by fsck to determine the order that file system checks are done at reboot time
    • root partition should have 1 here
    • other filesystems should have 2 here
    • filesystems that do not need fsck, or filesystems that are not always mounted, or removable media should have 0 here

Some special file system types can be included in /etc/fstab. The three most common ones are the swap partitions, the /proc pseudo device, and the /dev/pts pseudo terminal directory. These will be set up for you ate installation time, and you shouldn't need to fiddle with them.

Here is my fstab set up for the systems that I want loaded at boot time.

/dev/hdb2      swap          swap     defaults         0   0
/dev/hdb1 / ext3 defaults 1 1
/dev/hdb3 /usr ext3 defaults 1 2
/dev/hdb5 /usr/local ext3 defaults 1 2
/dev/hdb6 /opt ext3 defaults 1 2
/dev/hdb7 /home ext3 defaults 1 2
/dev/hdb8 /data ext3 defaults 1 2
/dev/hda1 /mnt/dosc vfat defaults,uid=1000,gid=100,umask=022 1 0
/dev/hda5 /mnt/dosd vfat defaults,uid=1000,gid=100,umask=022 1 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
mp3:/mnt/mp40 /mnt/music1 nfs defaults 0 0
mp3:/mnt/mp80 /mnt/music2 nfs defaults 0 0

No comments: