Author Topic: { solved } root does not have sufficient permissions ??  (Read 1148 times)

Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2437
  • Any Bugs in site?
An interesting problem has jumped at me, I am sure just to make my day.  I have a small 2GB USB memory stick I use as sort of 'notepad', always hanging off my operating system.

Today I came to save a file to the stick and I could not.  With konqueror I checked my permissions, gert:root, then I went to root Konq to change permissions to gert:gert but no go. Hmmmmm  >:(

What about Konsole, fdisk -l USB ?

Code: [Select]
Disk /dev/sdc: 2002 MB, 2002747392 bytes
32 heads, 63 sectors/track, 1940 cylinders, total 3911616 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 identifier: 0x4c672daa

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63     3911039     1955488+   6  FAT16

Code: [Select]
[root@localhost gert]# mount /dev/sdc /here
mount: you must specify the filesystem type
[root@localhost gert]# cfdisk /dev/sdc

[root@localhost gert]# mount LABEL=TOSHIBA /here
[root@localhost gert]# ls -l /here
total 1376
-rwxr-xr-x  1 root root  8962 Nov 22 00:11 00-ToDo_Items_Testing.glk*
drwxr-xr-x  2 root root 32768 Jan 24 10:59 01008xx-PCLOS_printing_duplex_problem/
drwxr-xr-x  2 root root 32768 Sep 22  2010 100722-sunnyday/
drwxr-xr-x 15 root root 32768 Jan  8 01:39 100728-Linux_Kollector/
-rwxr-xr-x  1 root root 23055 Aug  6  2010 100803-Linux_printing_how_to.glk*
drwxr-xr-x  3 root root 32768 Apr 27 01:00 100821-Linux_Xfer/
..
..
..

Ummmm, what do I make of this.  Any advice welcome  :-[
« Last Edit: May 12, 2011, 10:14:49 PM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: root does not have sufficient permissions ??
« Reply #1 on: May 05, 2011, 03:03:01 AM »
Quote
[root@localhost gert]# mount /dev/sdc /here

you should use: mount /dev/sdc1 /here, because your filesystem is on the first partition.
or
mount -t fat /dev/sdc1 /here

about permissions, check man mount, section "Mount options for fat", particularly uid, gid, umask.

AS

Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2437
  • Any Bugs in site?
Re: root does not have sufficient permissions ??
« Reply #2 on: May 05, 2011, 04:33:02 AM »
as
Yep you are right, I should never have started thinking  ;D.  and it is likely I would just have used /sdc1.  I was further thrown when it worked by using the LABEL annotation, nicely forgetting that the LABEL applies to partition.

Now to see why I can't change permissions as I use to.
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8590
  • Aurum nostrum non est aurum vulgi.
Re: root does not have sufficient permissions ??
« Reply #3 on: May 05, 2011, 04:44:22 AM »
Have you tried pmount /dev/sdc1 as normal user?
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2437
  • Any Bugs in site?
Re: root does not have sufficient permissions ??
« Reply #4 on: May 05, 2011, 05:09:31 AM »
Having a bit of fight here, both with my brain and the USB stick, not sure yet who will be the winner.

I was a bit remiss in above answer. Following much better answer.

Code: [Select]
[root@localhost gert]# mount /dev/sdc1 /here
[root@localhost gert]#

[root@localhost gert]# umount /there /here   <<------ notice umount on two directories, /here and /there
[root@localhost gert]#

[root@localhost gert]# mount -t vfat /dev/sdc1 /there
[root@localhost gert]#

Quote
                                         cfdisk (util-linux-ng 2.18)

                                             Disk Drive: /dev/sdc
                                        Size: 2002747392 bytes, 2002 MB
                              Heads: 32   Sectors per Track: 63   Cylinders: 1940

     Name             Flags          Part Type      FS Type                [Label]              Size (MB)
 -------------------------------------------------------------------------------------------------------------
     sdc1                             Primary       vfat                   [TOSHIBA]              2002.46


First part of my original post, totally off track with just using /dev/sdc I hope it is brainwashing from another difficult post.  ;D

I wanted to change some colour scheme for root Konq so it stands out compared with user Konq so I logged in as root and made the changes (background coloure light yellow and text blue).  At the same time looked at permission for partition LABEL=TOSHIBA,  which showed root:root, which I could not change in the root environment.

I have read up on the {man mount} no enlightenment so the battle goes on.  I will fire up another OS and test, then another pc
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: root does not have sufficient permissions ??
« Reply #5 on: May 05, 2011, 05:26:22 AM »
Wedgetail,

you problem is vfat or fat32, these filesystems do not have knowledge of owner and groups, and therefore you can't change owner and group
of a file resident  inside a FAT partitions. Linux, while mounting these filesystem, use virtual owner and groups!

If you mount the partitions as root user, you fill find that files are owned by root, if you mount the partition as gert you fill find that files are owned by gert.

AS

Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2437
  • Any Bugs in site?
Re: root does not have sufficient permissions ??
« Reply #6 on: May 05, 2011, 08:56:45 AM »
as
I understand the logic of what you are saying (had forgotten about fat/vfat and no permissions) more important about the ownership, that if I mount as user gert I own, or in linux permissions I will see gert as owner.

If as normal user I save a forum topic as print friendly file, to my Desktop directory, then look in the file with Konq or Konsole for permissions, will take konsole:

Quote
[gert@localhost ~]$ cd /home/gert/Desktop/
[gert@localhost Desktop]$ ls -l 110506-Permissions.htm
-rw-rw-r-- 1 gert gert 9376 May  6 00:00 110506-Permissions.htm
[gert@localhost Desktop]$

If I mount any vfat USB stick (have a number of these to exchange files between platforms) and then look at ownership I see following

Quote
[gert@localhost ~]$ ls -l /media
total 36
drwxr-xr-x 27 gert root 16384 May  5 23:57 TOSHIBA/
[gert@localhost ~]$ ls -l /media/TOSHIBA/
total 1376
-rwxr-xr-x  1 gert root  8962 Nov 22 00:11 00-ToDo_Items_Testing.glk*
drwxr-xr-x  2 gert root 32768 Jan 24 10:59 01008xx-PCLOS_printing_duplex_problem/
drwxr-xr-x  2 gert root 32768 Sep 22  2010 100722-sunnyday/
..
..
....

The file on the desktop I can not drag to the USB drive (I could not save it to the USB stick either of course) I guess it is fair enough a user can not save to a root group??

With my root Konq I can change change the group to root and then I can drag the file to the USB stick.
 
Quote
[gert@localhost ~]$ cd /home/gert/Desktop/
[gert@localhost Desktop]$ ls -l 110506-Permissions.htm
-rw-rw-r-- 1 gert root 9376 May  6 00:00 110506-Permissions.htm
[gert@localhost Desktop]$

I must have missed something real fundamental or more likely forgotten it.   :-[

I am tempted to say if I mount a USB stick as user, then the owner would automatically be user:user?
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: root does not have sufficient permissions ??
« Reply #7 on: May 05, 2011, 09:31:30 AM »
Do you remember MS-DOS ? it's the place where FAT filesystems born. MS-DOS was a single-user system, no owner, no groups, no others.
Accordingly to this "limited" view, FAT filesystems doesn't have any attribute to classifies file and directories ownership.

Unix/Linux, on the other side has always implemented the "*nix classic" ownership/permission scheme owner, group, others.

How can be mounted a FAT filesystem on a Unix Filesystem ? simulating the ownership/permission model.

Therefore yes, if you mount a fat filesystem as 'gert', the files will appear as owned by 'gert'. This is limited to FAT filesystem family and does not apply
to Linux/Unix native filesystems, therefore the behavior will be different depending on filesystem type.

When you 'gert' copy a file, you will create a new file and this will be owned by 'gert' even if the original/source is owned by some other user,
you 'gert' only need the read permission on that file to copy it, and then you will own the copy.

Quote
If I mount any vfat USB stick (have a number of these to exchange files between platforms) and then look at ownership I see following

when you mount a vfat, files will appear as owned from the current user.

Quote
[gert@localhost ~]$ ls -l /media
total 36
drwxr-xr-x 27 gert root 16384 May  5 23:57 TOSHIBA/
[gert@localhost ~]$ ls -l /media/TOSHIBA/
total 1376
-rwxr-xr-x  1 gert root  8962 Nov 22 00:11 00-ToDo_Items_Testing.glk*
drwxr-xr-x  2 gert root 32768 Jan 24 10:59 01008xx-PCLOS_printing_duplex_problem/
drwxr-xr-x  2 gert root 32768 Sep 22  2010 100722-sunnyday/
..
..
....

The file on the desktop I can not drag to the USB drive (I could not save it to the USB stick either of course) I guess it is fair enough a user can not save to a root group??

No, as far as I can see you 'gert' as owner of the USB stick contents, should have full read/write access to your USB stick... ???
let me check about, it sound like something is bugged, I will come back later about.

AS






Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: root does not have sufficient permissions ??
« Reply #8 on: May 05, 2011, 09:47:18 AM »
Quote
[gert@localhost ~]$ ls -l /media
total 36
drwxr-xr-x 27 gert root 16384 May  5 23:57 TOSHIBA/
[gert@localhost ~]$ ls -l /media/TOSHIBA/
total 1376
-rwxr-xr-x  1 gert root  8962 Nov 22 00:11 00-ToDo_Items_Testing.glk*
drwxr-xr-x  2 gert root 32768 Jan 24 10:59 01008xx-PCLOS_printing_duplex_problem/
drwxr-xr-x  2 gert root 32768 Sep 22  2010 100722-sunnyday/
..
..
....

The file on the desktop I can not drag to the USB drive (I could not save it to the USB stick either of course) I guess it is fair enough a user can not save to a root group??

No, as far as I can see you 'gert' as owner of the USB stick contents, should have full read/write access to your USB stick... ???
let me check about, it sound like something is bugged, I will come back later about.

Nope, can't replicate here. Copying files to USB fat32 formatted work as expected, I can copy files without any problems.

AS


Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2437
  • Any Bugs in site?
Re: root does not have sufficient permissions ??
« Reply #9 on: May 05, 2011, 05:49:58 PM »
as
As soon as something goes wrong it seems that my confidence is on holidays and not accessible until the problem is solved this is getting a bit annoying.  ;D

Yes I have been along with DOS from the start but only as a user.  I should have remembered about the lack of permission control in the DOS system as I did an entry level Novell Sys Admin course for the fun of it. Grrrrr.

Ok, I have just tried out the stick(s) in another PC and it work fine.  I think it is time to move the furniture again and remove that 2nd hard drive that has had me up the wall already.  Will have to wait till tonight as the sun is shining and I have taken a window section out so I can do some painting.

I will be back.
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2437
  • Any Bugs in site?
Re: root does not have sufficient permissions ??
« Reply #10 on: May 06, 2011, 09:29:16 AM »
Moved the furniture and got in the box again and removed the second hard drive, now I can save to my USB stick again.  In another thread unless I remove this drive I can not make a full install from a LiveCD of any kind. 

Would I like to know  ???
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Online wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2437
  • Any Bugs in site?
Re: root does not have sufficient permissions ??
« Reply #11 on: May 12, 2011, 10:14:10 PM »
Today, I decided to close my eyes and delete a lot of stuff on the /dev/sdb giving me selective permission troubles to the USB sticks.

I consolidated all the data from the /home directory on the various systems sitting here. Reformatted with mke2fs -t ext4 -L xxxx /dev/sdbyy leaving only /dev/sdb10 with the consolidated information which I was going to transfer to /dev/sda14 but before doing this I checked if I could save an archive file from Opera to the USB stick, one action that would fail without any error showing, the save never arrived.

The good news is that it worked.

I did find something I thought was odd, /dev/sdb1 was empty, but I don't recall cleaning it out as I thought I stored a crashed system here that I was working on finding lost data. Well for good measure I re-formatted this partition as well.

In the end I believe this thread was caught up in the problem with BIOS HDD order, this pc had HDD1, USB HDD, HDD2

It was when I got HDD1, HDD2, USB HDD set up that a lot of my problems got sorted out.


I will mark this solved.
« Last Edit: May 20, 2011, 07:50:54 AM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen