Jump to content

Accessing a removable USB HDD


Guest dhowse
 Share

Recommended Posts

Guest dhowse

I have installed Mandrake LE on my laptop. It has an external usb removable hard drive attached to it. Mandrake has detected this and mounted it. There is an icon on the desktop for this drive.

 

However when I log in as a user I cant access this drive. It says access denied and only has permissions for root.

 

How and where do I change the permissions so that I can access this drive as a user?

Link to comment
Share on other sites

Guest dhowse

dev/hda3 / reiserfs notail,noatime,acl,user_xattr 1 1

/dev/hdc /mnt/cdrom iso9660 user,iocharset=iso8859-1,noauto,ro,exec 0 0

none /proc proc defaults 0 0

/dev/hda1 /windows/C ntfs umask=0,nls=iso8859-1,ro,gid=users,users 0 0

/dev/hda5 /windows/E vfat umask=0,iocharset=iso8859-1,codepage=850,gid=users,users 0 0

/dev/hda4 swap swap pri=42 0 0

/dev/sda1 /mnt/removable ntfs pamconsole,exec,noauto,utf8,iocharset=iso8859-1,managed 0 0

Link to comment
Share on other sites

My entry is (KDE 3.4.1 system, removable devices managed by dbus/hal):

/dev/sdc1 /media/usbdisk ntfs user,exec,noauto,umask=0022,nls=utf8,comment=managed 0 0

(pamconsole patches are neither supported, nor needed in that system - namely Arch Linux).

The trick is done with the "umask" argument, but I also think that for NTFS you should define "nls", not "iocharset".

Link to comment
Share on other sites

There are a few complications here so this won't be as easy as I thought. First, the partition is formatted NTFS. You realize that linux can't write to NTFS; it will be strictly read only. If you're trying to write and get that error message that's why.

Assuming you can't even read the drive as an ordinary user but you can as root, your fstab indicates that the entry for the device(/dev/sda1) is being autogenerated by the hal daemon("managed" and "pamconsole"). "hal" stands for "hardware abstraction layer" and is a fairly new and complicated system for detecting and dealing with removable hardware. One thing hal does is autowrite an entry for removable storage devices in fstab when a device is connected and remove that entry when the device is removed.

That autodetection is nice but if it's not working there are things we can do. One thing you can do is create a hand entry for /dev/sda1 in fstab; hal should defer to that entry and not try to take over. If properly crafted you should be able to manually mount the drive. Before going into that post back and confirm that this is not just a write problem and that you can read the drive as root.

Link to comment
Share on other sites

Guest dhowse

Firstly thanks for all your awesome assistance. As a newbie who has take the plunge into Linux I need all the help I can get.

 

Secondly, I tried to change some of the fstab settings as per the 3rd post. I did this as root but they were not saved after I had checked the file. Strange, but then it may relate to what you have said.

 

You are corrent I have access as root and can read the drive fine. However as you correctly state, I cant even access it as my normal user account.

 

As for the filesystem NTFS I was aware I would not be able to write to it, but initally just needed read access. On that note what file system would I need to convert it to that could be readable by both Linux and WIndows?

Link to comment
Share on other sites

vfat (FAT32) is the only FS directly accessible as read/write under both Win and Lin. The partition should not be too large (not bigger than 32 GB).

Linux can write to NTFS in a couple of ways. One is the "captive-NTFS" wrapper, which gives R/W access with some limitations (only NTFS 5.1, used in WinXP, can be safely written, partition size is limited to 128G, and the write operations are very slow), and another one is Paragon's NTFS driver (ufsd), which is more secure and faster (not very fast though), but its commercial, and fails to compile the necessary modules cleanly on haevily patched kernels (like Mandrake's, for example).

ext2/3 and ReiserFS 3.X filesystems ARE readable under Windows, using a few free utilities, and more than that there's also write access for ext2/3 using third party commercial software (again by Paragon).

Link to comment
Share on other sites

Guest dhowse

OK thanks for the detailed info on the file systems. That helps for my future plans. However to get back to the original issue, what is the hand entry I would have to make for the fstab file so the hal daemon would refer to this?

Link to comment
Share on other sites

Disconnect the drive from your box and reboot. This entry should disappear from fstab:

 

/dev/sda1 /mnt/removable ntfs pamconsole,exec,noauto,utf8,iocharset=iso8859-1,managed 0 0

 

If it doesn't, delete it. Then add this entry:

 

/dev/sda1 /mnt/removable ntfs umask=0,nls=iso8859-1,user,noauto,ro 0 0

 

Open a console and make the /mnt/removable directory as that should have disappeared as well:

 

$ su

<enter root password>

# mkdir /mnt/removable

# exit

$

 

Next connect the drive back up to your box and turn it on; it should not try and automount or generate another entry in fstab. Check fstab and make sure nothing has changed. If that's good, go back to your console and as an ordinary user run:

 

$ mount /mnt/removable

$ ls /mnt/removable

 

The "ls" command lists all the files in the designated directory, here, /mnt/removable. You should see a full printout of all the files on the drive as that is the designated mount point for that partition on the external drive. In linux, a new partition is grafted on to the root tree through a mount point and accessed through that mount point. Also, open your file manager and navigate to /mnt/removable; you should be able to read all the files on the external hard drive.

In theory, having a hand entry in fstab for the external hard drive should stop hal from trying to take over and allow you to manually mount the drive.

Link to comment
Share on other sites

Guest dhowse

Thanks once again that worked well. However new problem.

 

I shutdown my laptop and restarted it after being away. Upon logging in as a user(my normal account), I went to the /mnt/removable

 

The mount was there but when I went into the folder there was nothing in it.

 

When I tried to manually mount it, just in case I needed to do that it came back with the

 

mount: special device /dev/sda1 does not exist

 

The fstab file wasunaltered and the hand entry still there from your previous directions.

 

Any ideas why I cant see the files on the removable drive?

Link to comment
Share on other sites

There could be a few things going on here. Did you have the external drive connected and turned on when you booted up? It's hard to say w/o being at your box but try this.

 

Open Mandrake Control Center(mcc)(Menu>System>Configuration>Configure your Computer, enter root password when prompted). In mcc go to System>"Enable or disable the system services". That will bring you to a listing of system services and daemons, their current status and whether they're configured to automatically start at boot. Three things could be causing the problem, harddrake, hotplug and/or haldaemon. Harddrake is a mandrake tool that automatically detects when new hardware is added during boot up and automatcally attempts to configure the new hardware. Harddrake is the most likely culprit if the external drive was turned on at boot time. Make sure the "on boot" box is not ticked for harddrake; if it is, untick it. Also, untick hotplug's on boot field. Haldaemon is what runs the hal system I previously told you about; it's not likely to be the problem so if its onboot filed is ticked, leave it that way for now.

 

Reboot and see if the problem goes away; if not, disable haldaemon onboot and try again.

 

Another thing to try - with the external drive plugged in and turned on run as root:

 

# fdisk -l

 

That should give a listing of all recognized partitions, whether mounted or not. See if anything is listed under /dev/sdax or /dev/sdbx.

Link to comment
Share on other sites

Guest dhowse

The hard drive is a USB so it powers up when the machine does, it is not the type with an external power switch.

 

I have tried everything mentioned in your previous post. I can access the /mnt/removable folder but no see anything.

 

I have also done the #fdisk -l and that did not show anything listed as /dev/sdax or /dev/sdbx.

 

Where to from here? I will put the configuration back to what it was prior to the above tests so we know where we are at.

 

The config is now haldaemon and hardrake on boot ticked

Edited by dhowse
Link to comment
Share on other sites

The hard drive is a USB so it powers up when the machine does, it is not the type with an external power switch.

 

I've never seen an external hard drive that didn't require it's own power; there is just not enough juice in the usb bus to power a hard drive AFAIK unless it's some kind of mini hard drive. What is the make and model of this thing? Is this a solid state device like a pen drive? Some pen drives have known compatibility issues in linux. Does the drive work consistently in windows? Is it working now in windows?

Try putting the thing on a different port; I suspect a hardware problem here.

 

From a pure linux point of view, check and post the output of:

 

# lsmod

 

In particular look for the scsi_mod, ehci-hcd, uhci-hcd, usbcore and usb-storage modules. You can manually load any missing modules with:

 

# modprobe <module name>

 

and then test with:

 

# fdisk -l

 

to see if the drive is detected.

Link to comment
Share on other sites

Guest dhowse

This is a laptop hard drive in a USB 2.0 enclosure that I carry all my documents around on. It is small and much more appropriate for the work I do. Hope this helps shed some more light on the situation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...