Getting Linux to recognize CDs, Flash drives, Disk partitions |
To auto-mount or not? |
Creating mount points |
The hard disk partition |
The CD(s) |
The Flash drive |
A Floppy drive |
Author |
Licence |
Getting Linux to recognize CDs, Flash drives, Disk partitionsThis article discusses editing the file /etc/fstab, so you have access to the items above. For setting up a disk partition visible to both Windows and Linux, see: http://savage.net.au/Linux/html/dual-booting.html To auto-mount or not?Auto-mounting means making a file system accessible as soon as you log in after booting. A hard disk partition will be available as soon as Linux boots, so in that case, auto-mounting makes sense. Since, at boot time, the CD drive may be empty, and the flash drive may not be plugged, auto-mounting in these cases is not appropriate. Creating mount pointsSometimes you have to use the mkdir command to create what's called a mount point, and sometimes you don't. A mount point is simply the name under Linux by which you refer to a drive. So, if your floppy is mounted at /mnt/floppy, then to list the files on the floppy, you would run this command: shell>ls /mnt/floppy I'm not really clear on this, so don't panic if the information below is not perfect. If you can't access a drive after editing /etc/fstab and rebooting, try creating the mount point manually, as below, and rebooting. The hard disk partitionThe article on dual-booting, mentioned above, gives you noe way to do it. Here's another: Edit /etc/fstab and add this line (modify as appropriate for your set up): /dev/hda4 /mnt/g vfat defaults 0 0 where hda is your '4'th partition on your first ('a') hard disk 'hd', and you've created the directory '/mnt/g' with: shell>mkdir /mnt/g and 'vfat' is the way that partition was formatted. The formatting program probably called it FAT-32, and 'defaults' is the options Linux is to use to access the partition. The 2nd last '0' refers to a dump program, which we can ignore, and the last '0' means do not perform a file system check at boot time. The CD(s)I have 2, an old read-only one and a newer burner. So we at to /etc/fstab: /dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0 /dev/cdrom1 /mnt/cdrom1 iso9660 noauto,owner,kudzu,ro 0 0 The Flash driveThis sits on a USB port, which is known to Linux as the first partition ('1') on the first ('a') serial device 'sd', so create the mount point with: shell>mkdir /mnt/flash and add this to /etc/fstab: /dev/sda1 /mnt/flash vfat noauto 0 0 A Floppy driveAdd this to /etc/fstab: /dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0 AuthorRon Savage. Home page: http://savage.net.au/index.html This POD was converted to HTML by /Perl.html#fancy-pom2.pl
LicenceAustralian Copyright © 2002 Ron Savage. All rights reserved. All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html |
| Top of page |