Devices and mounting notes

From Grokdoc

Jump to: navigation, search

Some distributions of linux, especially ones not using Gnome or KDE by default will require you to know a bit more to access your drives. Here are some common device names and how to mount them:

Note: You may need to specify the Filesystem type with the -t flag, a DOS floppy would be mounted with the command 'mount -t msdos /dev/fd0 /mnt/floppy'. Often you can specify -t auto to have mount autodetect what filesystem the disk uses, although this does not always work. The /mnt directory is simply used to mount all your disks, typically devices will be named 'floppy', 'cdrom', etc, however they can be arbitrarily named.

Can we maybe start with what is mounting? And why do I want to do it? GrokSaurus:Mount

Contents

Floppy

Device: /dev/fd0

Common types: vfat, msdos

Mount: mount /dev/fd0 /mnt/floppy


-Remember to unmount your floppy before ejecting it: umount /dev/fd0

CDROM

Device:

IDE primary slave: /dev/hdb

IDE secondary master: /dev/hdc IDE secondary slave: /dev/hdd

Common types: iso9660

Mount: mount /dev/hdX /mnt/cdrom

Note for multiple partitions /dev/hdb revers to the whole disk and /dev/hdb0 revers to the first partition, /dev/hdb1 second partition, etc.

//etc/fstab

This file stores mount information for all of your disks, if you install, for instance, a second CDROM drive, you will want to add the following line to your fstab (tab delimited): '/dev/hdd /mnt/cdrom2 iso9660 defaults 0 0'

The meaning of these fields is:

'Device Mount Point Type Options Dump Pass'

Device will always be a file in your /dev directory. As mentioned above, some common devices are /dev/hdc (Primary slave, usually the CD device) and /dev/fd0 (Floppy disk 0, the first floppy drive).

Mount point is an arbitrary directory in your filesystem. This will be the location you'll need to navigate to in order to access the files on your device after mounting. For convenience devices are often given mount points in the /mnt directory corrosponding to either what kind of device they are (cdrom, floppy, etc) or their /dev name (hda1, fd0, etc) or their network names.

Type is the kind of filesystem the device uses. This is the same as the -t switch for mount. Data CDs generally are iso9660, floppy drives some kind of FAT. Windows hard disks are probably VFAT if the operating system was Windows 9x and could be VFAT or NTFS if the operating system was Windows NT, 2000, or XP. Linux hard disks might be formatted as ext2, ext3, reiserfs, JFS, XFS, or any number of other filesystems. It may be possible to simply say "auto" here and have mount autodetect the format for you.

Options are parameters for the filesystem, such as noauto which causes the device to not be automatically mounted on boot, or user which allows non-root users to mount and unmount the device. What options are availible vary depending on what filesystem type the device uses. A full list can be found in the mount man page.

You will want to add devices to fstab when they are permenantly attached, such as cdroms, or hard drives.

fstab is parsed on boot, Linux will attempt to mount all devices listed in it, unless they are passed the 'noauto' option. It also has the added benefit of allowing you to simply type things like 'mount /mnt/cdrom' rather than 'mount -t iso9660 /dev/hdc /mnt/cdrom'

USB Drives

Depending on your linux distro flavor and kernel you might need to mount your usb devices as well.

I am running Fedora Core 2 and to get my usb drive up and running I simply type:

mount /dev/sda1 /mnt/usbdrive

So far this has worked with nearly every usb hard drive device that I own. This includes my TwinMos: Mobile Disk 3, Lexar Media: JumpDrive Trio, and my Samsung: Digimax 360 digital camera.

USB Question

How do I know what format to tell the mount command for a given USB device? For instance, my camera looks like a folder on my other computer. Should I then assume that it is FAT32? If this is the case, will I have to run samba to read/write from/to that device?

"Where are A: and C:?" and "What are mount points?"

I think with every newbie I founded on my way I had difficulties when explaining the "mount" concept (which is, in my opinion, an important one). Mandrake does it OK, from this point of view, with the supermount kernel patch: you don't have to know what you are doing to do it right. An important thing to realize, is that Windows does the same process of mounting disks as Linux does, just automatically. Many distributions will handle disk mounting automatically for you.

Having to umount a diskette before ejecting it is something hard to believe (even if you have to do this with USB-memories even in MacOSX, although in a "friendlier way"). This a serious usability issue. If supermount is not working, some clear sign should warn you against ejecting a disquette/USB-memory without unmounting it first.

Side note: a link from /home/user/disquette to /floppy proved to be useful, in my experience. Something equivalent could be done for the USB stick. Users should better not go out of their home directories, and not every desktop environment/application has a navigation bar with the disquette on it.

New author: On my other computer, when I plug my camera into the computer, a new folder appears. I haven't tried this on my Debian computer yet, because I'm scared. Will debian know how to read those files? The pictures on my camera just look like files on my other computer. I can copy them by dragging and dropping. But I don't want to break my camera by plugging it into by debian computer.

Personal tools

Click here to send an email to the editor of this weblog.

Amazon Honor  System Click  Here to Pay Learn
More



Hosting:
Ibiblio