Mailinglist Archive: opensuse (4053 mails)

< Previous Next >
Re: [SLE] usb ide removable hard drive
  • From: "Greg Krpan" <krpan@xxxxxxxx>
  • Date: Thu, 9 Aug 2001 12:32:37 -0500
  • Message-id: <OF8AD99F05.4E7E215B-ON86256AA3.005F9F68@xxxxxxxxxxx>

Hope this will help to get you a little further along:

>>1)I am assuming I have to mount the drive first to use it. So how do I
mount th drive. I know how to mount >>cdrom and floppy on the command
line because I
>> know the devices.

The first thing you need is the device name of the drive. If it's an IDE
drive, it should appear in /proc/ide. Your primary IDE drive should be
'hda' and your CD-ROM should be 'hdc'. The new drive will probably be
either 'hdb' or 'hdd'. Change into the directory for whichever the new
drive is, and verify that it's the correct one by looking at the following
files:
model
capacity
You should also look at the file '/proc/partitions', which will show you
all of the partitions on each drive

Performing a 'cat' on each file will show you the drive information. If
the drive has already been formatted (with DOS or NTFS) you can mount it
with the command "mount -t <filesystem type> /dev/hdXY /mnt"

<filesystem type> should be either 'msdos' or 'ntfs'. The 'X' will be the
device letter assigned (probably either b or d) and the 'Y' will be the
partition number, which can be determined from the /proc/partitions file.

If you want the drive to contain a linux filesystem, you will need to
create the filesystem before attempting to mount the drive.

>>2)Once I have mounted the drive I will need to format the whole drive so
I can
>> put files on it under linux. How do I do this manually. Since I
installed linux it has always been do >>automatically upon installation.


To format the drive, you can use the 'fdisk' utility. Typing 'fdisk
/dev/hdb' will edit the partition table on drive hdb. Typing ? will give
you the help screen. Create a new partition, and assign a partition type.
A linux partition is 'type 83', if I remember correctly. Save the
configuration and exit fdisk.

Now you can create a filesystem on the disk using mke2fs. If your
partition is /dev/hdb1 you would use the command "mke2fs /dev/hdb1"
Once that's complete you can mount the filesystem: "mount /dev/hdb1 /mnt"

You may want a different mountpoint (other than /mnt) which you can create
with mkdir. If this device will be connected at all times, you may want to
add the partition to the /etc/fstab to keep from needing to mount it
manually each time. If you would like to do this, add the following line
to /etc/fstab:

/dev/hdb1 /mountpoint ext2 defaults 1 2


Hope this answers your questions.

Greg Krpan (krpan@xxxxxxxx)
Senior System Administrator
Raytheon ITSS
USGS EROS Data Center, Mundt Federal Building
Sioux Falls, SD 57198
(605) 594 6854


< Previous Next >
Follow Ups