LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-15-2006, 02:10 AM   #1
Bazbo
Member
 
Registered: Mar 2004
Location: Seattle
Posts: 72

Rep: Reputation: 15
Can't write to external HD even as root


Hello,

I have a multi-boot system, currently running Xubuntu Dapper, 64 Studio, and, my newest addition, Zenwalk. I would like to be able to back up my files.

I used to be able to write to my external drive via USB but not e-SATA, and only on the Dapper install, not the 64 Studio (haven't tried it on Zenwalk yet). I tried it on 64 Studio as root.

The only way I could write to it in Dapper was to use the Sudo command to open the file manager, effectively running it as root. Then I could Cut/Copy/Paste to my heart's content (no drag and drop support, though).

Tragically, my Dapper install was overwritten when I installed Zenwalk. I have a new Dapper install now, and it doesn't write to the ext drive. When I try using the sudo mv command in the terminal, it tells me the drive is read-only. In the graphical file browser (default app is Thunar), the file icons have a lock symbol on them.

How come even root can't access this drive, and how do I give myself permission to write to it?

Thanks,

Paul in Seattle
 
Old 12-15-2006, 02:32 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
I had this problem a while ago, under similar circumstances. In my case it was a permissions thing. The error message was that I couldn't delete the file (say) because I didn't have permission to alter the parent directory.

I needed to change the ownership of the parent directory (/media/usbdisk in my case) so I could get read/write access to it's subjects.

The reason for this, I'm guessing, is something to do with the OS accessing the files is not the one that created them.

OTOH: I backed my /home directory to this drive under dapper, and I have full read/write access as a user under edgy.

Last edited by Simon Bridge; 12-15-2006 at 02:37 AM.
 
Old 12-15-2006, 08:00 PM   #3
Bazbo
Member
 
Registered: Mar 2004
Location: Seattle
Posts: 72

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Simon Bridge
I had this problem a while ago, under similar circumstances...

I needed to change the ownership of the parent directory (/media/usbdisk in my case) so I could get read/write access to it's subjects.
I would like to know how you changed the ownership of the parent directory, and how to find out what the parent directory is.

I have noticed other quirks.

When I right click on the drive's icon and select 'properties', sometimes it says the owner is root. Other times, if I unmount and remount, it will show the owner as my username and my real name, with read and write permissions--but I still can't write.

It also shows the group as 'me' (my username) with read only.

I tried going through Applications > System > Users and Groups to change permissions of the 'me' group, but can't see any way to change them. I also added 'me' to the 'root' and 'disk' groups. I hope that isn't dangerous. I don't want to have full root privileges when I log on as 'me'.

I was hoping to get the Zenwalk manual onto the drive so I could access it from Zenwalk, which doesn't have Internet access yet. I could burn a CD or print out pages, I guess.

Any idea what's going on?
 
Old 12-15-2006, 08:17 PM   #4
mattydee
Member
 
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479

Rep: Reputation: 48
Perhaps you need to mount the drive with the proper permissions.
You can do this through fstab (/etc/fstab).
Add rw (read write) to the options of the drive in question, as well as umask=000.(the umask is the default file creation permission)

if you mount with options umask=000 and rw, the resulting permission should be rw for root. YOu can add "users " if you want users to be able to write to the drive.

"umount /dev/whatever" and then "mount /dev/whatever"

Hope this helps a little...
Matt in Vancouver
 
Old 12-15-2006, 10:28 PM   #5
Bazbo
Member
 
Registered: Mar 2004
Location: Seattle
Posts: 72

Original Poster
Rep: Reputation: 15
I don't see the drive there:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sda4 / ext3 defaults,errors=remount-ro 0 1
/dev/sda1 /media/sda1 xfs defaults 0 2
/dev/sda3 /media/sda3 ext3 defaults 0 2
/dev/sda2 none swap sw 0 0
/dev/hdb /media/cdrom0 udf,iso9660 user,noauto 0 0

I can open it with the file manager and drag/drop files from it, but I can't drag/drop to it.

Where can I find the details of adding a drive to /etc/fstab?

Can I add it such that eSATA will work? That would be sweet. I bought an enclosure with this capablility, but so far only USB mounts. It won't boot the computer if I have it plugged in to the eSATA port, but if I boot first and then plug it in it is not recognised.
 
Old 12-16-2006, 12:29 AM   #6
mattydee
Member
 
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479

Rep: Reputation: 48
How many usb devices do you have plugged in? 4 including the drive?

If so then it should be one of the sda listings...

"fdisk -l sda" might give you a little more info on what all these sda mount points are, and hopefully help you identify which one it is.

"man fstab" for more info on fstab...
 
Old 12-16-2006, 12:10 PM   #7
Bazbo
Member
 
Registered: Mar 2004
Location: Seattle
Posts: 72

Original Poster
Rep: Reputation: 15
This device is the only USB device. I wanted to use it from the external SATA port, but it wasn't recognised. Now it has quit working in USB as well

In Dapper:

pad@Aurora2:~$ fdisk -l sda
pad@Aurora2:~$ fdisk -l

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 23586 189454513+ 83 Linux
/dev/sdb2 23587 24792 9687195 b W95 FAT32
pad@Aurora2:~$

64 Studio (Debian) and Zenwalk (Slackware) both return a "command not found" error for fdisk.

I notice fdisk can't seem to find my main internal SATA drive.

You can see I was able to partition the external drive via USB before it stopped working. The FAT 32 was so I could transfer family files bewteen Windows boxes.

I wish "plug and play" was as much a reality in Linux as it is in other OS's. I'd like to spend less time fixing the computer and more time getting work done on it.

Last edited by Bazbo; 12-16-2006 at 12:45 PM.
 
Old 12-16-2006, 01:31 PM   #8
mattydee
Member
 
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479

Rep: Reputation: 48
hmm... I don't think I can help you with the SATA part, but if you could at least get it working...

OK, so what you posted from fstab and fdisk are form the same system (distribution) right?

The disk you want to be able to write to is sdb, correct?

Then what I would do is add each partition (sdb1 sdb2) to you fstab. Some thing like this:

Code:
/dev/sdb1	 /whatever/youwant   auto  users,rw,umask=000	 0   0
/dev/sdb2  /what/ever  auto   rw,users,umask=000     0   0
Instead of "auto", you would probably want the proper fstab entries for the corresponding partition types (fat23, etc). Check man fsatb for this... I don't know the entries by heart.

You will probably have to set up the mount points manually: as root, simply mkdir /whatever/youwant.

notice the "users" "rw" and "umask=000" options are important, as explained above.

YOu would have to do this for each distribution that wants to access the external hard drive, (but with the proper /dev/sd??, configuration!)

Cheers
Matt

PS: if you get command not found for fdisk, make sure you are running as root.

Last edited by mattydee; 12-16-2006 at 01:35 PM.
 
Old 12-17-2006, 01:26 PM   #9
Bazbo
Member
 
Registered: Mar 2004
Location: Seattle
Posts: 72

Original Poster
Rep: Reputation: 15
Ok, I did all that, and it made no difference.

I tried making a directory and using that as the mount point,
sudo mkdir /mnt/blu
Then (as sudo) using the text editor to add
/dev/sdb1 /mnt/blu ext3 users,rw,umask=0000 0 0

to /etc/fstab, and saving, then rebooting for good measure.

I still couldn't write to the drive, so I changed the mount point to the the file path that the file browser uses to open the drive:

/dev/sdb1 /media/untitled ext3 users,rw,umask=0000 0 0

That didn't work either. I can drag and drop files from the external drive to the system drive, but not the other way around. From the command line, I get this:

pad@Aurora2:~$ sudo cp /home/pad/Desktop/manual_en.pdf /media/untitled
cp: cannot create regular file `/media/untitled/manual_en.pdf': Read-only file system
pad@Aurora2:~$

I'll reiterate that the "properties" box says the user "pad" is the owner and has read and write privileges. That's the same as before. [edit] Just tried it in Slackware/Zenwalk. "Failed to open directory USB. Permission denied".

What next?

Last edited by Bazbo; 12-17-2006 at 01:49 PM.
 
Old 12-17-2006, 02:56 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
cat /etc/mtab
 
Old 12-17-2006, 04:54 PM   #11
Bazbo
Member
 
Registered: Mar 2004
Location: Seattle
Posts: 72

Original Poster
Rep: Reputation: 15
pad@Aurora2:~$ cat /etc/mtab
/dev/sda4 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw 0 0
/sys /sys sysfs rw 0 0
varrun /var/run tmpfs rw 0 0
varlock /var/lock tmpfs rw 0 0
procbususb /proc/bus/usb usbfs rw 0 0
udev /dev tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
devshm /dev/shm tmpfs rw 0 0
lrm /lib/modules/2.6.15-26-386/volatile tmpfs rw 0 0
/dev/sda1 /media/sda1 xfs rw 0 0
/dev/sda3 /media/sda3 ext3 rw 0 0


What does this tell you?

It seems arcane to me, a mere end user.
 
Old 12-19-2006, 02:24 AM   #12
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by mattydee
Perhaps you need to mount the drive with the proper permissions. You can do this through fstab (/etc/fstab).
The old fstab/devfs days were easier to understand weren't they? He's using Xubuntu Dapper, which handles removable media via udev.

A wee test would be to "eject" the drive (but keep it plugged in) then attempt to mount it manually via the mount command. Here's me:
Code:
~$ fdisk -l

Disk /dev/sda: 80.0 GB, 80026361344 bytes
16 heads, 63 sectors/track, 155060 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

[snip]
~$ sudo mount -t ext3 /dev/sda1 /mnt
Password:
~$ ls -dl /mnt
drwxr-xr-x 4 simon root 4096 2006-12-15 21:34 /mnt
~$ ls -l /mnt
total 4
drwxr-xr-x 2 simon simon 4096 2006-12-09 02:10 backup
~$
... I can read and write to /mnt fine.

Compare:
Code:
$ cat /etc/mtab
/dev/hda1 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
procbususb /proc/bus/usb usbfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.17-10-386/volatile tmpfs rw 0 0
/dev/hda5 /home ext3 rw 0 0
/dev/hdc /media/cdrom0 iso9660 ro,noexec,nosuid,nodev,user=simon 0 0
/dev/sda1 /mnt ext3 rw 0 0
... that was with the drive mounted manually. With udev handling the mount automatically, that last line becomes:
Code:
/dev/sda1 /media/usbdisk ext3 rw,nosuid,nodev 0 0
Oh yeah...
[quote=Bazbo]I would like to know how you changed the ownership of the parent directory, and how to find out what the parent directory is.[quote]It's the mountpoint - browse the fs using the terminal, use cd .. and ls -l, until you find the directory which you don't have rw access to. For me, that was /media/usbisk.

Change ownership with "chown" and permissions with "chmod" as usual.

Last edited by Simon Bridge; 12-19-2006 at 02:27 AM.
 
  


Reply



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
Can't Write To Ext2 External HD But Reads Okay rrrssssss Linux - Hardware 8 11-08-2006 11:30 AM
write to external NTFS drive bluetwist Debian 2 07-29-2005 06:38 PM
New external disk; user cannot write Regulus Linux - Hardware 1 07-08-2005 05:40 PM
External USB drive -- only WRITE as root 1kyle Linux - Hardware 0 08-03-2004 10:00 AM
cannot write on external HDD trutnev Red Hat 2 03-20-2004 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:01 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
Open Source Consulting | Domain Registration