Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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:
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
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.
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!).
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.
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/...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.