The Temple of Fu

code, systems and games

Mounting devices within Linux

leave a comment »

Mounting Drives within Linux

This tutorial will hopefully explain how to mount drives, this includes floppys, cdroms, hardisks etc.

So you just got a nice drive and you wanna hook it up in your new slack machine.Well thankfully mounting drives is pretty much the same across all Unix based machines…well at least the ones I have come across.All you really need to know is the file system type and where you want to mount it, by this I mean where at in your file tree you would like to access it, for example: /mnt/myDrive.The file /etc/fstab is an important file,I suggest you take a few minutes to view it right know and familiarize yourself with its’ syntax.

I should mention that if you are installing a cd-rom drive after an install and all you are doing is replacing an old one, most likely you do not need to do anything as long as the device is located in the same position on the ide cable

cd-roms/cdrw/dvd/dvdrw

  1. After installing new drive and on first boot look in dmesg for info on new drive and then substitute /dev/hdd below with correct info.
    $dmesg
  2. First make a directory for the contents of the cd-rom.
    #mkdir /mnt/cdrom2 (change the mount point to whatever you feel like)
  3. As root open /etc/fstab with your favorite editor. You will notice the line:
    /dev/cdrom /mnt/cdrom iso9660 noauto,user,ro 0 0
    This really means:
    /device/devicetype /mountpoint/foldername filesystemtype don’tmountatboot,whocanmount,readonly bootcheckingno bootcheckingno
  4. 5. Since we are adding another cd-rom we need to add another line below this,add(and this is assuming that you have only 1 cdrom)
    /dev/hdc) /dev/hdd /mnt/cdrom2 iso9660 noauto,user,ro(change to rw if it is cd rw) 0 0
  5. Now you should be able to type and the contents of the cd would be in /mnt/cdrom2
    $mount /dev/hdc

The above work for dvd-roms and dvdrw drives.Just change the name of the folder to something to reflect the contents.

Hard Drives

The below is creating a mount point in the file system with permissions so that a user can mount the drive and umount the drive, and read write to the drive. Please adjust if this are not the correct settings you desire.
If this is to be used for Windows and Linux format as NTFS as most modern Linux distributions nowadays contain support for the NTFS format.

If this is being used for additional storage make a directory for it as so (If being used as additional storage for /home DO NOT make a directory!)
#mkdir /mnt/storage

Now add a line in /etc/fstab
/dev/hdb1(<<see dmesg for more info and correct hard drive info) /mnt/storage resierfs(<<whatever the type was you formatted the drive as) noauto,rw,user 0 0

I have this entry for an internal SATA drive
/dev/sda1 /mnt/storage ext3 noauto,rw,user 0 0

Now you can:
$mount /dev/sda1

Enjoy your new drive!

Advertisements

Written by lordfu

January 13, 2010 at 4:12 pm

Posted in Linux, Slackware

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: