modify permissions for a partition sabayon linux;4mounting

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

modify permissions for a partition sabayon linux;4mounting

Postby HenryP » Sun Oct 06, 2013 23:44

Hi,

I modified my /etc/fstab file to allow for mounting an ext4 partition... (my Sabayon is installed on a external usb3 hd), & apparently the disk referred to here, above, now seems to be mounting, but I think now, have a permissions problem (can't write any thing to it, & properties window shows same)...

The below is approximately the entry:
Code: Select all
dev/sda5       /run/media/user/hdfoldername      ext4    defaults        0 0


I have looked around... found mostly discussion about this problem re Ubuntu... & some more or less generic linux (chmod, etc.)

So question is, is there some place that discusses such questions of permission change for PARTITIONS (mine is a 2 TB, internal hd, to my HP Pavillion desktop, on which resides also Windows 8, which I dual boot with) on Sabayon (& guessing Gentoo might be similar enough, but this is a guess).

Thanks much for any help.

Henry
HenryP
Young Hen
 
Posts: 21
Joined: Thu Sep 26, 2013 17:19

Re: modify permissions for a partition sabayon linux;4mounti

Postby heindsight » Wed Oct 09, 2013 10:24

Hi Henry,

I suspect the problem might be with the ownership/permissions for the mount point.

Try running
Code: Select all
ls -ld /run/media/user/hdfoldername

to see who owns the mount point and what the permissions are. You can then use the chown and chmod commands to change the ownership and permissions to something sensible.
User avatar
heindsight
Baby Hen
 
Posts: 17
Joined: Wed Jun 19, 2013 16:46
Location: London

Re: modify permissions for a partition sabayon linux;4mounti

Postby linuxfluesterer » Wed Oct 09, 2013 11:21

Question: Is your USB hdd /dev/sda??? I wonder, I would expect, only internal drives are named with ... sda.
But in case, you'll boot with external hdd, then this may be accepted as /dev/sda, I'm not sure for that.
What you can do, is the following.
First, mount your /dev/sda5 to a shorter, fixed directory tree (e.g. /mnt/sda5). For this, you'll have to create the new directory /mnt/sda5. Then, you can change rights for that new directory.
This is a line from my /etc/fstab (adopted to sda5):
Code: Select all
/dev/sda5  /mnt/sda5               ext4     defaults   0 2

Now you should be able to mount /dev/sda5 with a simple:
Code: Select all
umount /dev/sda5
mount /dev/sda5 /mnt/sda5

Then you can create directories on this device (/mnt/sda5) as a root, e.g. with mc (midnight commander) or when you open a console and get to be root (use su command). Then you can change directory with:
Code: Select all
cd /mnt/sda5

And then you can change a directory's rights and permissions for a single directory or a directory tree with:
Code: Select all
chmod

Here, you may have a closer look:
http://www.thegeekstuff.com/2010/06/chmod-command-examples/

Because of the changed entry in /etc/fstab, /dev/sda5 will be mounted on /mnt/sda5 while booting.
Finally, I hope to help you.
I really hope, that by the Brexit (poor Britain), TTIP will be finally prevented. But don't get tired to talk to your local politician to open eyes for danger to democracy because of TTIP
User avatar
linuxfluesterer
Old Dear Hen
 
Posts: 703
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: modify permissions for a partition sabayon linux;4mounti

Postby HenryP » Thu Oct 10, 2013 20:34

[quote="linuxfluesterer"]
What you can do, is the following.
First, mount your /dev/sda5 to a shorter, fixed directory tree (e.g. /mnt/sda5). For this, you'll have to create the new directory /mnt/sda5. Then, you can change rights for that new directory.
This is a line from my /etc/fstab (adopted to sda5):
Code: Select all
/dev/sda5  /mnt/sda5               ext4     defaults   0 2

Now you should be able to mount /dev/sda5 with a simple:
Code: Select all
umount /dev/sda5
mount /dev/sda5 /mnt/sda5


Hi!

Thanks ALL for replies.

Indeed the drive in question is an internal drive --->/dev/sda5.

I'm a little puzzled on your suggestions in making a new directory (as explained here). My interpretation is that I would first 'mkdir' named 'mnt' in / (there is no such directory named that presently)... then I do 'mkdir' in 'mnt' named sda5? I have no experience making a new directory, directly under / so that's my real hesitation here (want to be sure I'm getting it correctly).

Regards,
Henry
P.s., thanks for the 'mc' hint, I installed it... but I think I'll stick with the terminal for now, as I think I want to learn how to use 'mc' before I do it for real... :?
HenryP
Young Hen
 
Posts: 21
Joined: Thu Sep 26, 2013 17:19

Re: modify permissions for a partition sabayon linux;4mounti

Postby linuxfluesterer » Thu Oct 10, 2013 21:20

Hallo...
You just surprise me. I'm not sure, /mnt is existing after first install on (hard)disk. If not, then you can create it in a konsole as root (su) with:
Code: Select all
mkdir /mnt

And then
Code: Select all
mkdir /mnt/sda5

mc is really helpful, especially, when you don't have any desktop. Since I know it, I always install and work with it beside Dolphin also.

-Linuxfluesterer (I love KDE ...)
I really hope, that by the Brexit (poor Britain), TTIP will be finally prevented. But don't get tired to talk to your local politician to open eyes for danger to democracy because of TTIP
User avatar
linuxfluesterer
Old Dear Hen
 
Posts: 703
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: modify permissions for a partition sabayon linux;4mounti

Postby HenryP » Thu Oct 10, 2013 22:51

[quote="linuxfluesterer"] I'm not sure, /mnt is existing after first install on (hard)disk. If not, then you can create it in a konsole as root (su) with:
Code: Select all
mkdir /mnt

And then
Code: Select all
mkdir /mnt/sda5


Well, I now have /mnt/sda5 & I followed your instructions... including changes to /etc/fstab. No /dev/sda5 in sda5... I tried remounting... terminal says that:
Code: Select all
/dev/sda5 is already mounted


I think I MAY POSSIBLY know what the problem is here (or part of it): my sda disk, which also has Windows 8, & needs authorization to mount.

Here is -ls from parted:
Code: Select all
# parted -ls /dev/sda
Model: ATA ST2000DM001-1CH1 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  1074MB  1073MB  ntfs         Basic data partition          hidden, diag
 2      1074MB  1451MB  377MB   fat32        EFI system partition          boot
 3      1451MB  1585MB  134MB                Microsoft reserved partition  msftres
 4      1585MB  896GB   894GB   ntfs         Basic data partition
 5      896GB   1981GB  1086GB  ext4         Basic data partition
 6      1981GB  2000GB  19.1GB  ntfs         Basic data partition          hidden


So if data from /dev/sda5 goes through /dev/sda (1, 2, 3, etc. ?) would not /dev/sda need a change in permissions also? (this may be not correct...).

Thanks,
Henry

P.s., one other note; I had to also guess which operators to use with chmod (I did:
Code: Select all
chmod u+r+w+x /mnt/sda5
Seems to me that my username should be there someplace?
HenryP
Young Hen
 
Posts: 21
Joined: Thu Sep 26, 2013 17:19

Re: modify permissions for a partition sabayon linux;4mounti

Postby linuxfluesterer » Thu Oct 10, 2013 23:31

Sorry, could you do a
Code: Select all
fdisk -l
as root (su), pls?
Then, Windows 8 isn't able to read ext4 file system as all I know...
And, can you do a
Code: Select all
mount
for me also, pls? Be careful. Don't mount /dev/sda without any number. I fear severe problems, if you won't receive an error...

-Linuxfluesterer (I love KDE ...)
I really hope, that by the Brexit (poor Britain), TTIP will be finally prevented. But don't get tired to talk to your local politician to open eyes for danger to democracy because of TTIP
User avatar
linuxfluesterer
Old Dear Hen
 
Posts: 703
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: modify permissions for a partition sabayon linux;4mounti

Postby HenryP » Fri Oct 11, 2013 1:19

linuxfluesterer wrote:Sorry, could you do a
Code: Select all
fdisk -l
as root (su), pls?
Then, Windows 8 isn't able to read ext4 file system as all I know...
And, can you do a
Code: Select all
mount
for me also, pls? Be careful. Don't mount /dev/sda without any number. I fear severe problems, if you won't receive an error...

-Linuxfluesterer (I love KDE ...)


Ok, here is the output of fdisk:

Code: Select all
# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.               
                                                                                                                               
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors                                                               
Units = sectors of 1 * 512 = 512 bytes                                                                                         
Sector size (logical/physical): 512 bytes / 4096 bytes                                                                         
I/O size (minimum/optimal): 4096 bytes / 4096 bytes                                                                             
Disk label type: gpt                                                                                                           
                                                                                                                                      #         Start          End    Size  Type            Name                                                                     
 1         2048      2097151   1023M  Windows recover Basic data partition                                                     
 2      2097152      2834431    360M  EFI System      EFI system partition                                                     
 3      2834432      3096575    128M  Microsoft reser Microsoft reserved partition                                             
 4      3096576   1749583871  832.8G  Microsoft basic Basic data partition                                                     
 5   1749583872   3869775871   1011G  Microsoft basic Basic data partition                                                     
 6   3869777920   3907029134   17.8G  Microsoft basic Basic data partition

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000f3fab

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     1026047      512000   83  Linux
/dev/sdb2         1026048  3907028991  1953001472   8e  Linux LVM

Disk /dev/sdc: 500.1 GB, 500107859968 bytes, 976773164 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a5476

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63   976768064   488384001    7  HPFS/NTFS/exFAT

Disk /dev/mapper/vg_muisicroom-lv_root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg_muisicroom-lv_home: 1936.6 GB, 1936560488448 bytes, 3782344704 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg_muisicroom-lv_swap: 9596 MB, 9596567552 bytes, 18743296 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes



This is the output of mount:
Code: Select all
 mount /dev/sda5
mount: /dev/sda5 is already mounted or /mnt/sda5 busy
       /dev/sda5 is already mounted on /mnt/sda5


Pretty much as before.
Henry

P.s., /dev/sdb is my Sabayon disk. & while making this attempt at mounting sda5 I noticed that I made a typo (misspelled music :oops: ) when I named this disk... a hint on how I might correct this (rename) if you can/would, would be appreciated ALSO.
HenryP
Young Hen
 
Posts: 21
Joined: Thu Sep 26, 2013 17:19

Re: modify permissions for a partition sabayon linux;4mounti

Postby linuxfluesterer » Fri Oct 11, 2013 7:42

HenryP wrote:...
Code: Select all
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000f3fab

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     1026047      512000   83  Linux
/dev/sdb2         1026048  3907028991  1953001472   8e  Linux LVM

This is the output of mount:
Code: Select all
 mount /dev/sda5
mount: /dev/sda5 is already mounted or /mnt/sda5 busy
       /dev/sda5 is already mounted on /mnt/sda5

Sorry, I said only 'mount', not 'mount /dev/sda5'! And, what makes /dev/sda5 busy?
And, it seems, that /dev/sda5 is mounted to /mnt/sda5 already because of entry in fstab, what makes sense.

HenryP wrote:P.s., /dev/sdb is my Sabayon disk.

Ok, that's fine. You should be able to access /mnt/sda5 anyway.Open a konsole, get root (su) and change directory then to /mnt/sda5. Now you should be able to use commands like 'chmod' (permissions) or chown (change users or groups). For that, mc is a good filemanager to do. But anyway, there is no way, not to learn about permissions in linux. Google for it, pls.

HenryP wrote: & while making this attempt at mounting sda5 I noticed that I made a typo (misspelled music :oops: ) when I named this disk... a hint on how I might correct this (rename) if you can/would, would be appreciated ALSO.

I've read, that it is possible to rename a logical volume. Here you can look for:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/LV_rename.html

I'm not sure, you'll need to unmount that lv before. And, I'm not sure, that is such pretty easy, I have no personal experience with logical volumes. Try to get more informations before you do, I suggest.

-Linuxfluesterer (I love KDE ...)
I really hope, that by the Brexit (poor Britain), TTIP will be finally prevented. But don't get tired to talk to your local politician to open eyes for danger to democracy because of TTIP
User avatar
linuxfluesterer
Old Dear Hen
 
Posts: 703
Joined: Thu Sep 20, 2012 19:47
Location: Germany

Re: modify permissions for a partition sabayon linux;4mounti

Postby HenryP » Fri Oct 11, 2013 20:07

linuxfluesterer wrote:
HenryP wrote:...
Sorry, I said only 'mount', not 'mount /dev/sda5'! And, what makes /dev/sda5 busy?
And, it seems, that /dev/sda5 is mounted to /mnt/sda5 already because of entry in fstab, what makes sense.

HenryP wrote:P.s., /dev/sdb is my Sabayon disk.

Ok, that's fine. You should be able to access /mnt/sda5 anyway.Open a konsole, get root (su) and change directory then to /mnt/sda5. Now you should be able to use commands like 'chmod' (permissions) or chown (change users or groups). For that, mc is a good filemanager to do. But anyway, there is no way, not to learn about permissions in linux. Google for it, pls.


I am afraid I've gotten a little confused... thought about this (after some unsuccessful efforts re your suggestions)... So I first deleted the entry in /etc/fstab, went back into windows, & with a utility (in Windows), deleted /dev/sda5 & made a new partition with NTFS format.

Now, when I "mount" it in Sabayon (it now actually shows up in the file manager), I can create a new folder (by right clicking the window)... but cannot remove it to "trash," & also cannot write to the disk ("I do not have permission to write").

So I went up on the directory tree... & see that the path /dev/sda5 got mounted to is /run/media/henry/BigDog).

Code: Select all
ls -ld /run/media/henry/BigDog/
drwxrwxrwx 1 root root 4096 Oct 11 10:12 /run/media/henry/BigDog/


All the files in the path have only root permissions... (there is another usb3 hd that is mounted there... the permissions are the same, root).

So, it seems to me that I need to change permissions recursively, from '/run' to 'BigDog' (& actually, I wish to have same permissions for any disk mounted there) from root to user. (??? This is a suitable mount point for me, as my other disk, mentioned is there)

Does this seem correct... ? & if so, perhaps you might outline how to do this.

Then, I assume that I more or less follow your suggestions for modifying /etc/fstab...

Thanks very kindly for your time & help!

Regards,
Henry

P.s., (this entry somewhat later than above) I think I found a further complication (?), it seems all of the above directories are mounted ALSO in '/var/run/media/henry' How the heck does that happen? & what to do? :roll: :?
Last edited by HenryP on Fri Oct 11, 2013 21:30, edited 2 times in total.
HenryP
Young Hen
 
Posts: 21
Joined: Thu Sep 26, 2013 17:19

Next

Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 2 guests