LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-03-2008, 12:30 AM   #1
Tom_ZeCat
LQ Newbie
 
Registered: May 2008
Location: Omaha, Nebraska
Distribution: Ubuntu
Posts: 20

Rep: Reputation: 0
can't write to external hard drive


I have a 120 gig external hard drive I've been trying to use under Ubuntu 7.10. I'm locked out of it for some reason. When I use the Linux file browser and try to drag and drop files into it, it says I don't have permission to do so. If I try to make a directory I can't. The "create folder" option is greyed out on the File menu.

This is an external drive that was originally an NTFS drive that I converted to an ext3 drive on my Windows XP machine via Partition Magic. When it was an NTFS drive, Ubuntu took FOREVER to boot up, and so I finally gave up and converted it to ext3.

In the file browser, the drive is simply called "disk". In the terminal, it's called /dev/sdc5.

I googled and read up on Unix terminal commands. Here's what I tried:

Quote:
sudo chmod -R 766 /dev/sdc5
When I return to the GUI, nothing's changed. I still cannot copy anything to the drive or make a directory. So I decided to be more liberal with the file permissions. I tried:

Quote:
sudo chmod -R 777 /dev/sdc5
Still can't write anything to the drive or make a dir. So I tried:

Quote:
sudo chown tom: /dev/sdc5
Still can't do diddly squat. I can copy to the 18 gig extra internal drive. So as an experiment I tried to kill its permissions:

Quote:
sudo chmod -R 444 /dev/sda1
If my experiment proves correct, I should no longer be able to write to that drive. Nope. In the GUI I can still write to it.

Back at the terminal, I check to see if my external drive's permissions have really changed. I try:

Quote:
ls -l /dev/sdc5
And I get:

Quote:
brwxrwxrwx
If I understand permissions correctly, that drive grants all of them. I should be able to write to it! Why can't I?

I've googled my fingers sore, but still have no idea why what I did wouldn't work.

Last edited by Tom_ZeCat; 05-03-2008 at 12:42 AM. Reason: wasn't done
 
Old 05-03-2008, 01:06 AM   #2
vortexdevice
LQ Newbie
 
Registered: Dec 2007
Location: Brazil
Distribution: Slackware 13 64-bit
Posts: 25

Rep: Reputation: 15
What is displayed if you type mount in a terminal?
 
Old 05-03-2008, 01:23 AM   #3
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Rep: Reputation: 38
First of all what does cat /etc/fstab say?


/dev/sdc5 Is the device you are mounting. It is not access to your file system. That is in a separate directory, usually /media or /mnt.

For example, I can access my windows partition. My fstab shows this for the windows partition.
Code:
/dev/hdc1        /win             ntfs        ro               1   0
The mount point is /dev/hdc1
I set it up so that the files are accessable at /win.
I can do cd /win to change to the windows directory.

In order to help others, let us know what you got.

This should help.
okos

Last edited by okos; 05-03-2008 at 01:24 AM.
 
Old 05-03-2008, 02:14 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
It probably would be better to reformat the drive to ext3 from Linux instead of using a windows program. The version of ext3 will be a better match then. For example, I don't know if Partition Magic will prepare the filesystem to be able to use acls. If an ext3 filesystem doesn't support some features they won't be enabled.

Your chown and chmod commands should be run on the mount point after the drive is mounted. Don't use the device name (/dev/sdc5).
This is for an ext3 filesystem. If the drive had a Windows filesystem like vfat, then you would use options in the mount command to gain access. Also for your ls command use the mount point, e.g. "ls -ld /media/disk"

Also, if you use the chown command, use the form "sudo chown owner:group mountpoint" or "sudo chown owner:group mountpoint" or just "sudo chown owner mountpoint" and use the chgrp command separately. If you use "sudo chown owner: mountpoint" I'm not certain how your system would change the group owner on your system. On mine, it used "owner:users" when I tried it out.

You need to run chown as root. You can use chgrp on a directory or file you own only if you are a member of that group.

Last edited by jschiwal; 05-03-2008 at 02:15 AM.
 
Old 05-03-2008, 06:36 PM   #5
Tom_ZeCat
LQ Newbie
 
Registered: May 2008
Location: Omaha, Nebraska
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
It probably would be better to reformat the drive to ext3 from Linux instead of using a windows program. The version of ext3 will be a better match then. For example, I don't know if Partition Magic will prepare the filesystem to be able to use acls. If an ext3 filesystem doesn't support some features they won't be enabled.
Done. I removed the partition and created a new one with Gparted. It appears now that the Maxtor external hard drive is now designated "disk" in the Ubuntu file explorer and as "/dev/sdd5" on the command line.

Here's what the disk looks like through Gparted's eyes right after I partitioned it in Ubuntu:

http://tommeinenphotography.com/netw...rtitioning.gif

What I don't get is why is it listed twice, once as "/dev/sdc1 extended 114.48 GiB," and again as, "/dev/sdc5 ext3 114.48 GiB"? Neither of these designations matches "/dev/sdd5" which I see at the command line.

Windows, and DOS before that, and CP/M before that always designated a letter for a drive, C:\, D:\ and so forth, which remained named the same thing whether you were at the command line or in the GUI. This is what's really confusing in Linux. It appears to name drives different things depending on the context, and my external hard drive appears to have 4 different names. Ack! I'm seriously in need of a Linux drives primer. If anyone can recommend a link that explains that, I'm all ears. I've been searching for such a thing.

I also notice that 7.84 megs are unallocated. I regard that as no big deal unless there's reason I should be concerned. I think that's probably a leftover from what Partition Magic did.

Quote:
What is displayed if you type mount in a terminal?
I get this:

Quote:
tom@toms-jukebox:/$ mount
/dev/sdb1 on type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.22-14-generic/volatile type tmpfs (rw)
security fs on /sys/kernel/security type securityfs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
Then after I rebooted, I got the same thing, plus these extra lines:

Quote:
/dev/sdd5 on /media /disk type ext3 (rw,nosuid,nodev)
/dev/sdc1 on /media/KINGSTON type VFAT (rw,nosuid,nodev,shortname=mixed,uid=1000,utf8,unmask=077,usefree)
/dev/sdc1 is obviously my 1 gig Kingston flash drive, which may or may not have been in before.

Quote:
First of all what does cat /etc/fstab say?
I'll reproduce it as closely as I can. It set up a kind of spreadsheet with things like "/proc" under "<mount point>". I'm going to keep that kind of thing together since I can't reproduce the spreadsheet.

Quote:
# cat /etc/fstab: Static file system information
# <file system>
proc

<mount point>
/proc

<type>
proc

<options>
defaults

<dump>
0

<pass>
0

#//dev/sdb1
UUID=a256a[and a ridiculously long combo of numbers and letters] ext3 defaults errors=remount-ro 0 1

#//dev
UUID=b583[and a ridiculously long combo of numbers and letters] none swap sw 0 0

/dev/sdc0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0

/dev/sdc1 /media/cdrom1 udf,iso9660 user,noauto,exec 0 0
I've been googling stuff like that fstab command you suggested, but I'm still confused on how to get my external hard drive the file permissions/assigned ownership I need to be able to copy to it.

I'm needing to backup a big music collection, 23 gig worth, that I've put a lot of effort into organizing. It would be disastrous to lose it after all this work, and this external drive is the key to getting it backed up. I backed up part of it to the previously unused 18 gig internal drive that I can copy to oddly enough.

I remain committed to getting this external drive to work. In any event, all help is very appreciated.
 
Old 05-03-2008, 08:21 PM   #6
vortexdevice
LQ Newbie
 
Registered: Dec 2007
Location: Brazil
Distribution: Slackware 13 64-bit
Posts: 25

Rep: Reputation: 15
At least the device is being mounted Read/Write.

Once the device is mounted you could run the command as root:

Quote:
chown username /media/disk
(with your username) to change the owner of the mount point. So you could have write access to the disk. I had to do the same thing some time ago.

In fact, the system linux uses to name its devices is far elucidative than the other mentioned ones, but you only must get used to it. And, as the drive is an external one, the device name can change. I have 2 external hdd, a digital camera, a mp3 and a cell phone that I connect to my laptop via usb, and the device name of all them change, accordingly to the order I plug them to the ports (no, I don't use all them together!).

Hope this helps!
 
Old 05-03-2008, 08:42 PM   #7
Tom_ZeCat
LQ Newbie
 
Registered: May 2008
Location: Omaha, Nebraska
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Hurrah! That worked. At last I can use this drive. Thank you so much for your help, and to everyone who responded. In fact in the Ubuntu file explorer, it says "/media/disk" in "location" when I click on the disk. Now I know what to look for next time.

Quote:
In fact, the system linux uses to name its devices is far elucidative than the other mentioned ones, but you only must get used to it.
You're absolutely right. If someone were to ask me what language is easiest, Spanish or German, I would reply instantly, "German, of course." Most people would say Spanish, but I studied German for four years and lived as an exchange student in Germany for a year. I've only dabbled in Spanish, and so it seems hard.

Right now Windows seems easier because I have years of experience using it. When I first got an MS DOS computer, I bought a book on how to use MS DOS and sat down and read a chapter per night till I was proficient. Then I couldn't understand why so many people kept saying that DOS was so hard to use. I'm thinking of ordering off for a good Linux book. I've googled and read articles, but maybe a good book would be a better, more organized way to get proficient.

In any event, it's only a matter of time before this hard Linux thing becomes easy. I am already seeing big advantages to using it over Windows.

Thanks again. I'm off to finally back up my files.
 
Old 05-03-2008, 08:51 PM   #8
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Rep: Reputation: 38
I know linux can be quite confusing at first.
Quote:
/dev/sdd5 on /media /disk type ext3 (rw,nosuid,nodev)
So linux mounts your usb drive at, /dev/sdd5. You could kind of say it is drive D: or E: if you compare it to windows.

However, you access the files at /media/disk.

In commandline you could ls /media/disk to list files on the usb drive.

A few tutorials:
http://www.linux.com/articles/113802

This wiki is specifically on mounting ntfs. But I learned alot from the wiki on mounting file systems in general.
http://www.linux-ntfs.org/doku.php?id=ntfs-en

The /etc/fstab file tells linux which file systems to mount at boot. And how to mount them. When you try to mount other file systems after you already booted, with the mount command, it will also look to the fstab file for info on that system you want to mount.

As I stated before, the /dev/... is the point where linux mounts or connects to the file system. In your distro, your file systems are accessed through /media/...

This should help.
okos

Last edited by okos; 05-03-2008 at 08:56 PM.
 
  


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 external hard drive sheine Linux - Software 3 02-20-2008 01:17 PM
Can't Write to External Hard Drive Sloppyunderfoot Linux - Hardware 2 08-18-2007 10:05 PM
External Hard Drive does not give me the permission to write erockallstar Linux - Newbie 22 01-29-2007 03:40 PM
Write permissions for external hard drive kg4ysy Linux - Hardware 1 05-19-2005 05:36 AM
Write to external USB hard drive Rob Roye Linux - Software 6 07-06-2004 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:56 AM.

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