LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-28-2016, 06:52 AM   #1
vargathon
LQ Newbie
 
Registered: Oct 2016
Posts: 2

Rep: Reputation: Disabled
Arch Linux: How to get access to my internal hard drive? Can't change permissions.


Hello. I have tried to use Arch for some time now, but I'm a total newbie in many areas. I have tried to google this problem for many hours now without any success so hopefully someone will help out

I'm running Arch Linux (specifically Antergos with default Gnome desktop).

The drive/partition I'm trying to access is /dev/sdc4. Let's assume my login username is Person. I formatted the partition as ext4 using GParted.

When I'm at file explorer and look at the Permissions tab, it says I don't own it and that I don't have the rights to change permissions.

I want the partition ( /dev/sdc4 ) to be fully accessible for the user Person.

Would someone give me the commands to copy-paste to terminal to make this happen? I would be very grateful
 
Old 10-28-2016, 07:51 AM   #2
vargathon
LQ Newbie
 
Registered: Oct 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Also to be clear, those "similar threads" below my post give me no answers at all So I really do need the commands or very clear advice.
 
Old 10-28-2016, 08:20 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Hi and Welcome to LQ!

GParted will make the partition as you've done, you also need to make a file system.

Since you're using ext4, the command you'd want to use would involve being root or using the sudo command:
Code:
$ sudo mkfs.ext4 /dev/sdc4
Once the file system is created, you need to mount it, typically you create a directory for mounting in the /media tree:
Code:
$ sudo mkdi /media/anyname
$ sudo mount -t ext4 /dev/sdc4 /media/anyname
This should mount the file system under /media/anyname. You can continue to use sudo to manipulate ownership and group. A good thing to check is to see what group the user "Person" is, typically this is also "Person". For instance if I make a user "frank", it typically also has a group "frank". My point there is the next set of command are to change the owner and group of the file system to match your user "Person".
Code:
$ cd /media/anyname
$ sudo chown -R Person *
$ sudo chgrp -R Person *
This changes recursively down sub-directories -R (not that you need it with a new file system and nothing yet under it), all file ownership (chown) to be owned by the user "Person", and next changes the group (chgrp) for all files in the file system to belong in the group "Person".

At this point you should be all set and files should be accessible by user Person.
 
Old 10-28-2016, 08:45 AM   #4
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Required reading: https://wiki.archlinux.org/index.php...and_attributes

(See in particular the heading "Changing ownership")
 
Old 10-28-2016, 09:17 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Let me try to clarify a few things.
If you want to have a directory (e.g. /home/Person) and everything in it writable by user Person in primary group Users the syntax is
Code:
chmod -r Person:Users /home/Person
You generally do not want the system to be writable by anyone except root, so the directory '/' should not be user writable for security reasons. Data directories under /home can be user writable. System directories (everything else in /) generally should not be. The only exception I have is a mount point for external drives, and that had to be set in /etc/fstab.

A simple google search finds all of this stuff for you, and you learn quicker if you dig it out yourself.
 
Old 10-28-2016, 09:30 AM   #6
pressman57
Member
 
Registered: Feb 2005
Location: Escondido Ca.
Distribution: Arch
Posts: 118

Rep: Reputation: 29
You can have the partition mounted at boot with an /etc/fstab entry. For example:



/dev/sdc4 /media/anyname rw,auto,user 0 0

If the disk is a usb drive you probably should use a UUID number instead of /dev/sdc4. To find it type sudo blkid /dev/sdc4.
 
1 members found this post helpful.
  


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
[SOLVED] Second Internal Hard drive detected but cannot access ryu Linux - Hardware 5 06-09-2012 08:12 AM
change permissions of the second hard drive jmding Linux - Hardware 6 12-19-2006 03:42 PM
Why Will ubuntu not let me access my internal hard drive on my laptop? linuxuser2003 Ubuntu 3 03-18-2006 01:15 AM

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

All times are GMT -5. The time now is 03:36 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