LinHES Forums
http://forum.linhes.org/

Automatically mount USB harddisk and how make it writable
http://forum.linhes.org/viewtopic.php?f=6&t=4661
Page 1 of 1

Author:  aspain [ Sun May 22, 2005 5:37 am ]
Post subject:  Automatically mount USB harddisk and how make it writable

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

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

edit /etc/fstab
/dev/sda1 /mnt/ximeta rw,user,noauto 0 0

edit /etc/auto.removable
ximeta -fstype=vfat,user,exec,uid=1002,gid=1002,umask=002 :/dev/sda1

edit /etc/auto.master
/var/autofs/removable /etc/auto.removable --timeout=2


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


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

Author:  cesman [ Sun May 22, 2005 3:18 pm ]
Post subject:  Re: automatically mount USB harddisk and how make it writabl

aspain wrote:
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
Perhaps re-reading the reason for the failure might be helpful... Automount removable devices is something that is being worked on.

Author:  Xsecrets [ Sun May 22, 2005 4:25 pm ]
Post subject: 

Quote:
usbmount depends on udev (>= 0.053-1); however:
Package udev is not installed.


odd how the error messages will tell you what is wrong if you take the time to look at them.

perhaps try apt-get update apt-get install udev

Author:  aspain [ Mon May 23, 2005 6:19 am ]
Post subject: 

Here is what I have done :


root@mythtv:~# apt-get update
Hit http://www.pcxperience.org unstable/ Packages
Ign http://www.pcxperience.org unstable/ Release
...
Get:18 http://ftp.us.debian.org unstable/non-free Sources [27.0kB]
Get:19 http://ftp.us.debian.org unstable/non-free Release [88B]
Fetched 5339kB in 2m35s (34.3kB/s)
Failed to fetch http://debian.tu-bs.de/knoppix/nx/slh-d ... ackages.gz 404 Not Found
Reading Package Lists... Done
E: Some index files failed to download, they have been ignored, or old ones used instead.

root@mythtv:~# apt-get install udev
Reading Package Lists... Done
Building Dependency Tree... Done
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
udev: Depends: hotplug (>= 0.0.20040329-17)
Depends: initscripts (>= 2.85-16) but it is not going to be installed
Depends: makedev (>= 2.3.1-77) but 2.3.1-75 is to be installed
W: Couldn't stat source package list http://debian.tu-bs.de ./ Packages (/var/lib/apt/lists/debian.tu-bs.de_knoppix_nx_slh-debian_._Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.tu-bs.de ./ Packages (/var/lib/apt/lists/debian.tu-bs.de_knoppix_nx_slh-debian_._Packages) - stat (2 No such file or directory)
W: You may want to run apt-get update to correct these problems
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).[/list]Do you know how to correct this problem ?
I use R5A12

Author:  charlesdm [ Fri May 27, 2005 11:28 am ]
Post subject: 

Even if you get that disk mounted, I believe NTFS is still read only under Linux. From what I have read, NTFS write support is very basic and in a very early form.

See this LINK for more details.

Author:  aspain [ Sat May 28, 2005 4:10 pm ]
Post subject: 

Ok

Author:  tassitano [ Mon Aug 15, 2005 8:02 pm ]
Post subject: 

I just try to configure my usb hard drive to be mounted/unmounted automatically.

When I connect my usb drive to my pc, I receive this message :

Aug 15 17:03:09 mythtv kernel: usb 5-1: new high speed USB device using ehci_hcd and address 2
Aug 15 17:03:09 mythtv kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Aug 15 17:03:09 mythtv kernel: usb-storage: device found at 2
Aug 15 17:03:09 mythtv kernel: usb-storage: waiting for device to settle before scanning
Aug 15 17:03:11 mythtv usb.agent[9977]: usb-storage: already loaded
Aug 15 17:03:14 mythtv kernel: Vendor: WDC WD16 Model: 00BB-00FTA0 Rev: 15.0
Aug 15 17:03:14 mythtv kernel: Type: Direct-Access ANSI SCSI revision: 00
Aug 15 17:03:14 mythtv kernel: SCSI device sda: 312581809 512-byte hdwr sectors (160042 MB)
Aug 15 17:03:14 mythtv kernel: sda: assuming drive cache: write through
Aug 15 17:03:14 mythtv kernel: SCSI device sda: 312581809 512-byte hdwr sectors (160042 MB)
Aug 15 17:03:14 mythtv kernel: sda: assuming drive cache: write through
Aug 15 17:03:15 mythtv kernel: sda: sda1
Aug 15 17:03:15 mythtv kernel: Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Aug 15 17:03:15 mythtv kernel: Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0
Aug 15 17:03:15 mythtv kernel: usb-storage: device scan complete
Aug 15 17:03:16 mythtv scsi.agent[10021]: disk at /devices/pci0000:00/0000:00:1e.0/0000:02:04.2/usb5/5-1/5-1:1.0/host0/target0:0:0/0:0:0:0


The system detect my hard drive but mount nothing



Should I do something like that ?

edit /etc/fstab
/dev/sda1 /mnt/ximeta rw,user,noauto 0 0

edit /etc/auto.removable
ximeta -fstype=vfat,user,exec,uid=1002,gid=1002,umask=002 :/dev/sda1

edit /etc/auto.master
/var/autofs/removable /etc/auto.removable --timeout=2


/etc/init.d/autofs restart

Author:  RichardBronosky [ Fri Jan 20, 2006 10:46 am ]
Post subject:  It's been a while now, update please

Is this issue resolved yet? Cecil stated
Quote:
Automount removable devices is something that is being worked on.


Is this in place yet?

Author:  cesman [ Fri Jan 20, 2006 11:54 am ]
Post subject: 

Works for CDs. I guess you have not been keeping up with the changelog. ;)

Author:  Verzweifler [ Tue Jul 18, 2006 11:42 pm ]
Post subject: 

I ran into the very same problems and elaborated the following solution, which I do not claim to be perfect. But since it works, I am fine with it.
However, my situation is perhaps a little different, because I do not want to "dynamically" mount my USB hardware but I want to mount it at boot.

First, forget about usbmount, udev and the like. Installing them (or trying to) will throw a lot of unresolved dependencies. I stopped trying when apt-get told me not to remove mount-aes ... :shock:

My device is recognized as /dev/sda1 and I could mount it manually, but after adding it to /etc/fstab, a reboot results in magically "shifting" it to /dev/sdb1, so it is actually not mounted (and probably never will, using this approach). This might be due to the fact that mounting devices is done prior to starting hotplug being in charge of detecting USB devices.

I therefore ask my box to "manually" mount /dev/sda1 as part of the boot-scripts. That mount must occur quite late in the bootup sequence (at least AFTER hotplug being started), so I used a new "S99" entry in /etc/rc5.d and symlinked it to /etc/init.d/mountUSB.

/etc/init.d/mountUSB
Code:
#! /bin/sh
/bin/mount -t ext3 /dev/sda1 /mnt/usb/drive


in /etc/rc5.d:
Code:
 ln -s ../init.d/mountUSB S99mountUSBdevice


That worked for me...

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/