LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-15-2013, 02:40 PM   #1
rbrtscornell
LQ Newbie
 
Registered: Jul 2013
Posts: 3

Rep: Reputation: Disabled
I set up an ext4 partition on external HD to store media files. permission issues


I recently bought a WD external hard drive for storing file of several types. Using gparted I made two partitions, one ntfs for windows files and an ext 4 for linux files. Strangely, I have complete access to ntfs partition from linux side of duel boot system, but do not have permission to access ext4 partition. My root password does not work when I use su to gain root access. It works fine on built in hard drive.
 
Old 07-15-2013, 03:09 PM   #2
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,431

Rep: Reputation: 102Reputation: 102
Did you format the ext4 partition (using mkfs.ext4 or the Disk Utility application or similar)? The next thing to check would be the permissions at the root of the partition. I have a Toshiba 1 TB external drive. I labeled it "rahtherbig" when I created the file system using Disk Utility. It auto-mounts at /media/ratherbig. ls -l /media shows the permissions:

drwxrwxrwx. 14 ken ken 4096 Jun 30 11:51 ratherbig

This allows any user to write to the drive. To set these permissions I used the command:

sudo chmod 777 /media/ratherbig

If you need more specific help, please tell us what flavor of Linux you are using.

Ken
 
Old 07-15-2013, 04:51 PM   #3
rbrtscornell
LQ Newbie
 
Registered: Jul 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
I use ubuntu 12.10. I have changed the permission successfully, but still no permission.

output from ls -l

steve@ubuntuSteve:~$ cd /media/steve
steve@ubuntuSteve:/media/steve$ ls -l
total 12
drwxr-xr-x 3 root root 4096 Jul 15 07:52 ext 4
drwx------ 1 steve steve 8192 Jul 14 19:20 Windows
steve@ubuntuSteve:/media/steve$

How can I change ownership of ext 4 from root to steve? That should fix it. Can't figure out how to use chown.
 
Old 07-15-2013, 05:11 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
chmod/chown are your friends

There are a few things you can do.

1. make the mount point owned by user/group steve. do this with the drive UNMOUNTED.
Code:
# chown -Rf steve:steve /path/to/mount/point
1a. you might need to look at the df -Th command to see its exact mount point. it will look something like this:
Code:
[user@centos ~]$ df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
              ext4     50G  4.8G   43G  11% /
tmpfs        tmpfs    939M     0  939M   0% /dev/shm
/dev/sda1     ext4    485M  144M  317M  32% /boot
/dev/mapper/vg_centos-lv_home
              ext4    1.8T  1.4T  277G  84% /exports/centos
/dev/sdb1     ext4    1.4T  1.2T  131G  90% /exports/NFS_TV_Shows
in the last line you can see a non-LVM mounted internal HDD. your external will look very much like that. it will be /dev/sdX# at the beginning of the line and /path/to/mount/point at the end of the line.

2. set the permissions on the mount point.
Code:
# chmod -R 755 /path/to/mount/point
3. manually mount the external drive. the reason for the manual mount is so that you can change the permissions on the drive it self.

Code:
# mount /dev/sdX# /path/to/mount/point
so in my system that command would be:

Code:
# mount /dev/sdb1 /exports/NFS_TV_Shows
4. repeat steps 1 and 2 above with the drive mounted. Then you can log out of root from the terminal and you should have access to the mounted drive as user. Keep in mind that the user still does not have normal permissions to mount/umount the device. In most distros that is reserved exclusively for the root user. You can modify the sudoers with the mount/umount for the mount point.

Last edited by lleb; 07-15-2013 at 05:12 PM.
 
1 members found this post helpful.
Old 07-15-2013, 05:36 PM   #5
rbrtscornell
LQ Newbie
 
Registered: Jul 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
can't unmount drive
 
Old 07-15-2013, 06:28 PM   #6
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,431

Rep: Reputation: 102Reputation: 102
Make sure you are not on the ext4 partition (pwd will show your present working directory) and that it is not in use by some other programs. You can unmount it by sudo umount /media/steve

OR... I guess you are using the Unity (looks like an overgrown smart phone) interface. Click on the Ubuntu button at the top of the menu and search for Disk Utility or palimpsest. That neat little application will allow you to do many things with and to your storage media such as mount, unmount, format etc.

But to change ownership of the partition you do not need to unmount it. But I do not think you need to change ownership either. USB devices are a little different from "normal" hard drives. The /media/something mount point is created by the system when the device is plugged in. Try setting permissions to 777 rather than 755. That should allow anyone to create directories and files from the root of the ext4 file system on the drive. chown steve /media/steve with 755 would allow YOU to create directories and files but not other users (if there are any).

If not please post back. I am setting up a Ubuntu 12.04 virtual machine with Unity as I do not normally use the Unity interface and I am a bit rusty to walk you though it. I have a couple of 12.04 machines but they are running the gnome interface (so they look more like a computer :-)

Ken
 
Old 07-15-2013, 07:05 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,911

Rep: Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267
You forgot to post the output you got when you tried to unmount the drive. You also forgot to post the command you used so someone you could tell you if it was not done properly. In your second post above, you show the line below for your ext 4 partition. You have a space in the directory name which is going to cause problems in a terminal. Either use and underscore between ext and 4 or change the name to ext4. I don't know that this will resolve your current problems because I don't know what you did or the result of it. Post commands and warning/error messages in situaitons like this. It simplifies things for you and people trying to help you.
Quote:
drwxr-xr-x 3 root root 4096 Jul 15 07:52 ext 4
Then either change to owner or permissions as suggested above.
 
Old 07-17-2013, 05:32 AM   #8
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
Lightbulb


sudo umount -f /dev/sdx -- Force it.

I would reboot the system first and go straight to the terminal and try again first. You were probably accessing ( or attempting ) the drive.
 
Old 07-18-2013, 05:55 AM   #9
EduPorteņo
LQ Newbie
 
Registered: Oct 2012
Location: Argentina
Distribution: Ubuntu - Knoppix
Posts: 21
Blog Entries: 2

Rep: Reputation: Disabled
Trying to solve a similar problem with Ubuntu 12.04 LTS, I entered in a terminal
ls -l /media as taylorkh said.

MACHINE
drwx------ 11 eduardo eduardo 16384 Dec 31 1969 DATOS

ME
sudo chmod 777 /media/DATOS

After unsuccessfully testing the access to DATOS by other user, I entered
ls -l /media
again and the machine answered
drwx------ 11 eduardo eduardo 16384 Dec 31 1969 DATOS
again.
 
Old 04-20-2015, 12:15 PM   #10
Benzopal
LQ Newbie
 
Registered: Apr 2015
Posts: 1

Rep: Reputation: Disabled
Exclamation Above problem fixed the usezr friendly way

You Linux guys are making things way too complicated. I guess you enjoy this but that's definitely not the case for everyone and sure not the questioner.

So we are going to make things less complicated and more user friendly. Sure Ubuntu didn't go that far with usability just to have this one trait go unnoticed?

Well then buckle up!

Answer: Format the partition and there you go!

Speaking about taking the bull by the horns.

So again: Format the partition, even if that's already done by the partition program. Never mind the data since it's a fresh partition, right? Just make sure you are logged into your Ubuntu as yourself, duh! obviously. Then, as you format your fresh partition as you yourself you'll become the owner of it

Last edited by Benzopal; 04-20-2015 at 12:16 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cannot execute files on ext4 partition Arancaytar Linux - Software 11 03-11-2013 11:46 AM
Set NTFS (fuseblk) external media to mount with UTF-8 filesystem dotancohen Linux - Newbie 2 12-25-2010 12:21 PM
unable to set write permission on vfat formatted partition csravi88 Linux - Newbie 1 12-20-2010 11:42 PM
Permission issues after installing external USB disk drive Maarten_Holland Linux - Newbie 2 02-01-2006 10:27 AM
Partition where i can store my files while formatting anti.corp Slackware - Installation 1 12-02-2005 04:44 PM


All times are GMT -5. The time now is 11:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration