LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-13-2005, 07:27 AM   #1
cn_chopsticks
LQ Newbie
 
Registered: May 2005
Location: Nanjing, China
Posts: 17

Rep: Reputation: 0
How to mount USB hardisk?


Hello, this is the first time i come here.
i just want to mount portable USB hardisk in RedHat Linux 9.0,
but i don't know how to accomplish this, i know how to mount a flashdisk
using "mount -t vfat -o iocharset=gb2312 /dev/sda1 /mnt/usb", but when i
apply that command on a USB hardisk, it doesn't work.
Could someone give me some advice? Linux is a whole new world to me...
Forgive me if i thank you some hours or some days later because my access to the internet is limited by time.
Thanks!!

大家好,这是我第一次来到这个论坛,谢谢!!
 
Old 05-13-2005, 08:23 AM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Leave out the "-o iocharset=gb2312" bit and see if that helps.

If not - well, has it been partitioned? If so, is it FAT? If you're not sure, try running "fdisk -l" or "cfdisk /dev/sda" and see what it tells you. . .
 
Old 05-13-2005, 08:24 AM   #3
depdiver
Member
 
Registered: Aug 2004
Distribution: RedHat Enterprise, SLED 10, Freespire
Posts: 49

Rep: Reputation: 15
Does it give you an error message?
 
Old 05-15-2005, 01:13 AM   #4
cn_chopsticks
LQ Newbie
 
Registered: May 2005
Location: Nanjing, China
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks,oneandoneis2 and depdiver
when i use "mount -t vfat /dev/sda /mnt/usb", the error message is
"/dev/sda is not a valid block device"
so i tried "mount -t auto /dev/sda1 /mnt/usb", but the same error message
appeared.
so, oneandoneis2 and depdiver, what is the device name for a external USB
hdd?
my USB hdd was partitioned with several partitions, and all the partitions were formated with fat32.
Best reguards!!
 
Old 05-15-2005, 03:23 AM   #5
kiss_linux
Member
 
Registered: Mar 2005
Location: Calgary Canada
Distribution: Mandriva 10 / LE 2005
Posts: 46

Rep: Reputation: 15
you can double check device name for hd, when you connect usb to box, as root do
" tail /var/log/messages " and you will see something like
Kernel: Attached scsi disk sda at scsi1, channel 0, id 0, lun 0 ( where sda is device name )

and as you have partitions on disk, i suggest samething as oneandoneis2 did, try running as root "fdisk -l"
 
Old 05-22-2005, 02:55 AM   #6
cn_chopsticks
LQ Newbie
 
Registered: May 2005
Location: Nanjing, China
Posts: 17

Original Poster
Rep: Reputation: 0
i solved the problem!!
in redhat 9 with the kernel 2.4.20-8, you have to compile the kernel if you want to use the usb-storage
the following is how i did:


First, edit the file /usr/src/linux-2.4.20-8/Makefie, from the beginning, you will see the value like this "EXTRAVERSION =XXXX", replace it with "EXTRAVERSION =-8", this step is very important!!
you may have the question, "why should the value be -8?", sorry, i don't konw why, but remember, it depends on the kernel you are using. For example, if you are use the kernel 2.4.20-8, you must replace "EXTRAVERSION =XXXX" with "EXTRAVERSION =-8"

Second, modify the header file /usr/src/linux-2.4.20-8/drivers/usb/storage/unusual_devs.h
in the file, find the sections like the following:
UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0x0001,
"EagleTec",
"External Hard Disk",
US_SC_SCSI, US_PR_BULK, NULL,
US_FL_FIX_INQUIRY ),

if you find that, modify it with following:
UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0x9999,
"EagleTec",
"External Hard Disk",
US_SC_SCSI, US_PR_BULK, NULL,
US_FL_FIX_INQUIRY | US_FL_MODE_XLATE | US_FL_START_STOP ),

Ok, after that do the following:
#cp /boot/config-2.4.20-8 /usr/src/linux-2.4.20-8/.config
then, change your directory to /usr/src/linux-2.4.20-8/
and go on:
#make mrproper(if you have compiled the kernel, add this command)
#make oldconfig
#make dep
#make modules (this step will expend considerable time)

All right!! everything is almost ready!!
just a few steps:
#cp /usr/src/linux-2.4.20-8/drivers/usb/storage/usb-storage.o /lib/modules/2.4.20-8/kernel/drivers/usb/storage/
after that step, you can plug your USB hdd.

then:
#modprobe -r usb-storage
#modprobe usb-storage(if you compile the kernel correctly, no error message will appear)

after that, try this command:
fdisk -l
did you see the info about you USB hdd?

everything is ready, just mount!!
#mount -t vfat /dev/sda1(the number may be different) /mnt/your directory

Maybe it's helpful, thanks all the friends above!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
about installing linux on a usb hardisk samgu3990 Linux - Hardware 12 11-28-2005 04:59 PM
Upper and lower case problem when mount hardisk UltraSoul Linux - Newbie 1 10-28-2005 09:50 AM
umount the usb hardisk bxr1981 Red Hat 1 08-17-2005 05:11 AM
How to mount USB hardisk? cn_chopsticks Linux - Newbie 10 05-22-2005 05:03 PM
How to mount HFS+ (journaled) hardisk? carboncopy Slackware 12 12-01-2004 11:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration