-   Linux - Software (
-   -   Mounting a HD... (

rmd3boy 06-30-2003 10:31 PM

Mounting a HD...
Hey all, I'm kinda new to Linux, but I finally got fed up with Windows... and I'm switching over to Linux... I am currently running RedHat 9.0... anyways... I want to mount a spare HD that I have because I have all of my files on it... its a storage HD... I have my Mp3s, and other important files... how would I go about mounting it... there isnt an OS on it... just files... its a FAT32 drive... if you could list any steps I would need to take... or what I would type at terminal.... I'd really appricate it! BTW its listed at "hdh" Thanks ALL in advance!

MasterC 06-30-2003 10:41 PM

First figure out what device it's listed as:
fdisk -l (FDISK -L lowercase)
Find the "fat" listing, then:
mkdir /mnt/fat32 (as root, for all of this)
mount -t vfat /dev/hdx /mnt/fat32 -o users,umask=002,uid=500,gid=500,noexec,rw

If it all works out and you can list the files in /mnt/fat32 as a user, then add this to your /etc/fstab:
/dev/hdx /mnt/fat32 vfat users,umask=002,uid=500,gid=500,noexec,rw 0 0

Where /dev/hdx is the device you found from the fdisk command above.



contrasutra 06-30-2003 10:42 PM

Add this to your /etc/fstab (as root):

/dev/hda3 /mnt/windows vfat auto,defaults,umask=000 0 0

replacing /hda1 with hdh1 (or whatever # partition it is) , and replace /mnt/windwos with whatever directory you want to mount it to.

Make sure you manually create that mount directory and give it proper permissions (like not "read-only" or something)

PS. Could you write in seperate sentances, and not with ".....", thanks.

EDIT:\\ MasterC beat me to it. :D

fancypiper 06-30-2003 10:46 PM

# Managing drives
LNAG - Accessing my drives
Rute - Device Mounting

rmd3boy 06-30-2003 10:46 PM

Isn't fdisk to format or something?

fancypiper 06-30-2003 10:51 PM

fdisk is a partitioning tool and the command given is "list the partitions ya' got on that sucker".

fancy@tinwhistle $ su -

root@tinwhistle # fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 4865 cylinders
Units = cylinders of 16065 * 512 bytes

  Device Boot    Start      End    Blocks  Id  System
/dev/hda1  *        1      1217  9772056    c  Win95 FAT32 (LBA)
/dev/hda2  *      1217      1229    99855  83  Linux
/dev/hda3          1230      1656  3429877+  83  Linux
/dev/hda4          1657      4865  25776292+  5  Extended
/dev/hda5          1657      1719    506016  82  Linux swap
/dev/hda6          1720      2146  3429846  83  Linux
/dev/hda7          2147      2573  3429846  83  Linux
/dev/hda8          2574      3719  9205213+  83  Linux
/dev/hda9          3720      4865  9205213+  83  Linux

Disk /dev/hdb: 255 heads, 63 sectors, 9729 cylinders
Units = cylinders of 16065 * 512 bytes

  Device Boot    Start      End    Blocks  Id  System
/dev/hdb1  *        1      1218  9778072+  c  Win95 FAT32 (LBA)
/dev/hdb2          1218      9729  68370088+  83  Linux
root@tinwhistle #

mkfs is to format

Sparky 07-01-2003 07:47 AM

I hope I can clear it up a little. In case it's not obvious, Linux treats EVERYTHING as a directory (stating the obvious usually gets a "duh" response so I hope this isn't too insulting). As such, you need to make a "dummy" directory somewhere so that you can later mount your hard drive to it. It's kind of a waste of a directory name, but as long as you have the "dummy" directory created somewhere on your current Linux system it really can't hurt too much except for the pittance of space the name takes up (or wastes). I believe the suggestion was to make the directory named /mnt/fat32, but you can really call it anything you like and you can even put the dummy directory anywhere you like. However, there is a good reason these "dummy" directories are placed in the /mnt directory and making your "dummy's" name in the /mnt is not a bad habit to get into too (there's also a good reason for this, but it's not a critical one; however, it is getting off topic). The important thing here is to mount your hard drive with the right syntax since mounting it as a reiserfs type file system if it's a FAT32 will almost surely result in an error or worse! Using the Linux fdisk or cfdisk utility will help you find out what Linux sees it as -- just make sure you don't change or delete anything |-I ! Once you mount your hard drive you access it by logging to that "dummy" directory. When mounted correctly, that dummy directory will actually have all the data on your hard drive! :-D

Other key factors to remember are how your BIOS see's your drive (is it IDE master or slave and on what controller?), if the drive is partitioned (does Windows or any other OS see it as 2 or more drives even though it's really one physical drive?), and if the drive data is compressed or not (if it is compressed then it would be a matter of whether or not Linux has the tools to deal with it, but it would be more work!). The Linux tools fdisk and cfdisk can tell you quite a lot without destroying any data -- unless you want it to (by making changes and writing those changes before exiting fdisk/cfdisk). The previous suggestions "should" work if all assumptions are correct. By writing this out I hope it makes more sense since it's pretty easy to give syntax and shorthand on skills that not everyone has (yet). ;-) L8R

mayankjohri 07-01-2003 09:20 AM

hello sharky is it directory or file. I think linux treats every thing as file.

Sparky 07-01-2003 05:08 PM

The thing you make that is "bogus" is a directory. You might like to think of it as "fake" or "bogus" since without linking a drive (or something) to it that the empty directory really serves no purpose. However, even directory "names" take up space on your Linux system's hard drive even if they are empty -- and some folks are VERY particular about every single byte of hard drive space. So you see, Linux doesn't exactly treat "everything" as a file (nor does DOS/Windows). To see that, you should know about the ls -l command and the little tiny "d" that shows up when you have a directory. It's much more obvious when you use a GUI like KDE or Gnome, but the principal is the same -- there are directories and there are files and to link a drive to your system you need to use a directory. I'm NOT an expert, but this I do know. L8R...

fancypiper 07-02-2003 05:53 AM

# Linux filesystem structure
Directory Navigation Help File
Filesystems, Directories, and Devices Help File
Proper Filesystem Layout

All times are GMT -5. The time now is 04:27 PM.