From: cs@zip.com.au (Cameron Simpson) Subject: Re: [LinuxRedHatInstall] mount syntax Date: 29 Nov 1999 00:00:00 GMT Message-ID: <19991129102838.A17266@ixus.research.canon.com.au> Approved: newsgate@newsgate.IAEhv.nl References: <3841A71A.9B040F73@home.com> Organization: IAE newsgate Followup-To: poster Reply-To: cs@zip.com.au Newsgroups: linux.redhat.install On Sun, Nov 28, 1999 at 03:05:14PM -0700, CS wrote: | how do i mount my other hard drive into a linux directory? Basicly you say mount -t type device mountpoint where "type" is the filesystem type (ext2, FAT, etc), "device" is the name of the UNIX device representing the drive (or more commonly for hard drives, the partition of the drive which has the filesystem you wanted to mount) and "mountpoint" is where the filesystem will appear in the UNIX directory tree. This is detailed under "man mount". Your first IDE hard disc is named "/dev/hda", your second "hdb" and so forth. SCSI discs are named "/dev/sda", "sdb" etc. Those are named for the device as a whole (the whole disc, not slices (aka partitions) of it). Supposing your second disc is named "/dev/hdb", then the partitions are named "hdb1", "hdb2" etc. You can find out what partitions are on a disc (assuming it _is_ partitioned, which fixed discs tend to be and removable discs tend not to be) by saying: fdisk -l /dev/hdb to list the partitions. For our boot disc (hda) here I get: [home/cameron]#janus*> fdisk -l /dev/hda Disk /dev/hda: 32 heads, 63 sectors, 330 cylinders Units = cylinders of 2016 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 34 307 276192 6 FAT16 /dev/hda2 308 329 22176 83 Linux /dev/hda3 * 1 2 1984+ a OS/2 Boot Manager /dev/hda4 3 33 31248 16 Hidden FAT16 This shows that this disc has 4 partitions. The main two are hda1 and hda2, being the old Windows C drive (hda1) and the LINUX /boot partition (hda2). You can see the Boot Manager there (this is/was a multiboot machine) on partition hda3. We choose to mount the legacy Windoze drives under /mnt on our Linux box, so C: is mounted as /mnt/C, so forth. To mount that: - The mount point must exist, so mkdir /mnt/C chmod 755 /mnt/C This need be done just once. - Mount the partition onto that directory. From the above table you can see that the FAT16 partition is named "/dev/hda1", so: mount -t vfat /dev/hda1 /mnt/C "vfat" is a Linux filesystem driver which recognises FAT16 and FAT32 Windows filesystems. Now you can ls the /mnt/C directory etc. Thus: [home/cameron]#janus*> ls /mnt/C Program Files config.sys ffastun.ffo msdos.--- setuplog.old windows autoexec.bat detlog.old ffastun0.ffx msdos.sys setuplog.txt bootlog.prv detlog.txt ibminst netlog.txt suhdlog.dat bootlog.txt ffastun.ffa io.sys recycled system.1st command.com ffastun.ffl logo.sys scandisk.log temp To make this happen at boot time you need to make an entry in your /etc/fstab file, which lists filesystems, mountpoints and whether thy should be mounted automatically or not. See "man fstab" for details. Here's the first few lines of janus' fstab file: /dev/hdc8 / ext2 defaults 1 1 /dev/hda2 /boot ext2 defaults 1 2 /dev/hdc7 swap swap defaults 0 0 /dev/fd0 /mnt/floppy ext2 noauto 0 0 /dev/cdrom /mnt/cdrom iso9660 user,noauto,ro 0 0 /dev/hdc1 /opt ext2 defaults 1 2 /dev/hda1 /mnt/C vfat ro,uid=500 1 2 /dev/hdc5 /mnt/E vfat uid=500 1 2 You can see: / comes from our main drive, hdc (master on the second IDE bus; hdb would be the slave on the first IDE bus), because our boot drive (hda) is fairly small. /boot from hda a swap area on hdc descriptions for the floppy and cdrom so we can say mount /mnt/floppy or mount /mnt/cdrom because mount knows to read /etc/fstab to find out the details. /opt from hdc /mnt/C from hda (Windows C: drive) /mnt/E from hdc (Windows E: drive) On these last two, that "uid=500" line is because Windows doesn't understand users, so we're saying when we mount these, pretend all the files are owned by uid 500 (which is Kath). That should get you started. Cheers, -- Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/ Why be politically correct when you can be right? - Geoff Miller -- PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES! http://www.redhat.com http://archive.redhat.com To unsubscribe: mail redhat-install-list-request@redhat.com with "unsubscribe" as the Subject.