LeRoy on 10 Mar 2013 10:06:37 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] File ownership under Linux


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 03/10/2013 11:04 AM, Eric H. Johnson wrote:
> Hi all,
> 
> I am running into a problem running an executable cross compiled on
> Ubuntu for X86 and targeting an Arm7. I suspect the problem may
> have to do with ownership. I am using Ubuntu 12.04 on an X86 to
> target to an Arm7. I have successfully compiled a patched kernel
> which successfully boots to it and a Debian Wheezy image. I am now
> trying to port some utilities which I have successfully compiled on
> the x86 with the same tool chain. There is no packaging system in
> place so I am just copying files.
> 
> The file I want to run is an executable, so if I try the fully
> qualified path, running as root on arm7: /usr/bin/xenomai/latency
> 
> I get an error to the effect that there is no file or directory by
> that name.
> 
> Here is what I need clarification on. Everything on the Arm7 runs
> on an SD card, so at the moment I just plug the SD into the x86
> computer and copy the files I need. When I copy I am running as
> root on the x86. After I boot to the SD from the Arm7 and check the
> file ownership and attributes they are:
> 
> root:root and -xrw-xr-xr respectively.

What file system are you running on the SD chip?

If the SD chip is using a Windows file system then all files are
automatically root:root ownership.  Also how is the SD chip mounted?
You can see this by issuing a mount command.

There are some distributions that mount FAT and NTFS file systems as
ro (read only) and noexec (non executable).

> 
> But even so I have used chmod and chown to force the ownership and 
> attributes, but see no discernible difference.

As stated above FAT and NTFS file systems cannot have ownership and
permissions changed.

When I mount /windows on my dual boot laptop mount shows:
/dev/sda1 on /windows type fuseblk
(ro,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

On my Debian system a NTFS file system mounts with setting the user_id
and group_id which cannot be changed with chown.  Also if the file
system is mounted with noexec then you cannot run even a script.

To change this you need to run
mount -o remount,etc

Read the man page for mount to check on all of the options available.

ls -lh /windows
drwxrwxrwx 1 root root 4.0K May 22  2009 Temp
drwxrwxrwx 1 root root 4.0K Oct 10  2008 Users
- -rwxrwxrwx 1 root root 1.4M Nov  7  2007 VC_RED.cab
- -rwxrwxrwx 1 root root 5.6K Nov  7  2007 vcredist.bmp
- -rwxrwxrwx 1 root root 228K Nov  7  2007 VC_RED.MSI
drwxrwxrwx 1 root root  28K Mar  3 10:06 Windows

If you are putting linux on a SD chip first I would make the
filesystem either ext3 or ext4 or any other UNIX type filesystem.

Personally I create SD chips as encrypted chips which require
cryptsetup LuksOpen /dev/sdc1 sandisk

Then I can mount /dev/mapper/sandisk /mnt/sandisk

I hope that this helps :-)

- -- 
 Rev. LeRoy D. Cressy  mailto:leroy@lrcressy.com   /\_/\
                       http://lrcressy.com        ( o.o )
                       			           > ^ <
		       Cell Phone:  267-307-3527

Open PGP Key:     C34B77CC
gpg fingerprint:  8AD5 35EF 1FDF F1A7 E483  8CCE A50D 4E81 C34B 77CC

For info on enigmail:    http://enigmail.mozdev.org/
For info on gpg:         http://www.gnupg.org/

Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me. (John 14:6)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCgAGBQJRPL19AAoJEI9ujBCAoueI04sP/1qftpOz/RDJOkkE6DXoOnIE
F+M1THopohJ1AI12bZ1IQ+7u6lL8MNB030sNP8j+RF4X/iv5bP5CPzlyDLarPjMS
eosRZ29sNb9txMI6JbNenpHV5bHmXStbBJX3GJfP/sSYFKVcMToXITj4jAP/17ty
BD3JBrZ/rf9JA7X/ziQUptnZzyiTwIPR94a5sG7460qIx63LYlmP/snTKQbg4uUr
NmQj6gfUc054ZzbK+LyZ8+stgUz3diTDEgTiqCdOanebIJYDltgF3kiUgEtyQe3Y
umkeUCsu4SUUDYIAMeG09sTZ8vbiqMeyt2Rxv0nls1Qbg/qA+n3m2sILcWkddcis
dLIRKCXCmdRicvlPtILLO+y4J9pa5HDlifWYBILjtY8jDleaZgC1gHqAMSf1DqMl
j6UFd+OrYgY/F/2bCt1amcmf/BuikZcWY1yDW/dsp2brF3wBiGwWCPEg+VTkqSKg
on3Pklm0KDBqO3hDeOAVqNLn63qvfwy58Vg/odQjcgmaYp0qBESZL+OFVJnV+zKQ
Je5J8GunIgeszMwU6jlXQIgLxDwAsIWUFNJ+AiBcG8refJqyjW1IULRW2PciAd9c
wHknfDUSSAn+k8wrHI1tYLs9T635rGBDvDq1XG2VrjgTNhTzZbQ09ROwPc42/e95
xi2It3vfO2TvpvNXCb81
=+1Ji
-----END PGP SIGNATURE-----
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug