LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to mount USB hardisk? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-mount-usb-hardisk-323078/)

cn_chopsticks 05-13-2005 07:01 AM

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!!:)

大家好,这是我第一次来到这个著名的Linux论坛,谢谢!!

rpb 05-13-2005 07:26 AM

hi,

are you sure that your hard drive is a vfat device? what error does it give when you try the command you mentioned? may be if you try ext2 it might work, if the problem is to so with the file system. also, i think the follwoing link could be helpful..

http://www.tldp.org/HOWTO/Flash-Memory-HOWTO/index.html

-rpb

tuxrules 05-13-2005 08:26 AM

Refer to this thread.

you can then use the mount command like this

mount -t filesystem-name /dev/device-partition /mnt/directory-of-your-choice

Poetics 05-13-2005 08:37 AM

Some distros come with USB hdd support compiled in. In Slackware, for example, you only have to do the following:

mkdir /usb (so you can mount it)
mount /dev/sda1 /usb

cn_chopsticks 05-15-2005 12:15 AM

Thanks,rpb, tuxrules and Poetics!
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, rpb, tuxrules and Poetics, 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!!

siyeclover 05-15-2005 07:07 AM

You should run command
fdisk -l
to verify your usb harddisk's devicename and filesystem.


siyeclover

Poetics 05-15-2005 07:24 AM

When I mounted my USB drive (or tried to), using /dev/sda it gave me that same problem, but hitting /sda1 instead fixed it.

Try it without the "-t auto" and see what happens.

cn_chopsticks 05-22-2005 01:52 AM

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!!

tassitano 05-22-2005 06:29 AM

automatically mount a harddisk and how to make it writable
 
Anyone know how to automatically mount a harddisk and how to make it writable ?

My harddrive is netdisk (ximeta)
and my partition is ntfs

I use debian
Here is my command line to mount my drive :

mount /dev/uba1 /mnt/disk
/etc/init.d/autofs restart



Here is what I have done to mount automatically my harddrive :
============================================
/etc/auto.master
/mnt/removable /etc/auto.removable --timeout=10
/mnt/disk /etc/auto.win --timeout=60


/etc/auto.removable
usbdrive -fstype=vfat,uid=diwaker,gid=users,rw,umask=002 :/dev/uba1


/etc/init.d/autofs restart


But...I can't see my harddrive in /mnt/disk
============================================


I found a script (USBMOUNT) that could do that thing for me but when I try to dpkg -i the .deb, the system throw me an error. Here is the script : http://usbmount.alioth.debian.org/


root@mythtv:~# dpkg -i usbmount_0.0.11_all.deb
Selecting previously deselected package usbmount.
(Reading database ... 54575 files and directories currently installed.)
Unpacking usbmount (from usbmount_0.0.11_all.deb) ...
dpkg: dependency problems prevent configuration of usbmount:
usbmount depends on udev (>= 0.053-1); however:
Package udev is not installed.
dpkg: error processing usbmount (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
usbmount

brianez21 05-22-2005 03:49 PM

Quote:

usbmount depends on udev (>= 0.053-1); however:
Package udev is not installed.
dpkg: error processing usbmount (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
usbmount
That package needs you to have udev installed.
Try running:
# apt-get update
# apt-get install udev
and then install the package

brianez21 05-22-2005 04:03 PM

I'm having a problem, I just recently bought a Maxtor OneTouch II external harddisk for my laptop.
Under Windows, it works fine with both USB and FireWire, however on Ubuntu I can only open it (/dev/sda1) with USB, not FireWire.
However, I know my card is being detected.
Quote:

0000:03:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 46)
Any ideas?

Note: It is detected fine in FC3.


All times are GMT -5. The time now is 08:01 AM.