LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-01-2006, 02:54 AM   #1
karpa
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Rep: Reputation: 15
Can't change permission


Hi, I am running Ubantu, and just have inserted a new removable device (Usb memory stick).
I have logged in a root and still can't change permission. The current permission is 700 and want to change it to 755. When I cick on the properties of the removable volume and select the permission tab, and try to check mark the permissions they get disable about half a sec after I enable them.
 
Old 03-01-2006, 03:35 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,594

Rep: Reputation: 124Reputation: 124
Your memory stick is probably formatted with FAT32, i. e. "vfat" in terms of the mount command. You cannot change permissions on a vfat partition if it is mounted, instead you have to give it the option "umask=xxxx" to the mount command. Take a look for example here on linuxquestions what it means or in the man pages. It is contrary to the way permissions normally work. An umask of "000" means no prohibitions, that means read, write and executable rights for anyone. Maybe you have also to change the gid and uid options to assign the device to a certain group or user.

That having said, I don't know how to change this automount behaviour in Ubuntu. But maybe a search with usb vfat automount umask etc. will get you further how to solve your problem specifically.
 
Old 03-01-2006, 03:36 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
Maybe because your usb stick is formatted with a FAT filesystem? And vfat does not handle permissions :in Windows, you can't change permissions on fat also , its only on NTFS
 
Old 03-01-2006, 05:21 AM   #4
karpa
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
Yes you are right, its formatted with FAT32.
How do I format it with Linux?

Thanks in advance
 
Old 03-01-2006, 06:02 AM   #5
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 54
I would not recommend putting another filesystem on it - except if you want to use the USB-stick for linux only.
If you format it with ext2 for example - windows will not be able to read the stick anymore - unless you install the tools to do it on every machine you might come across...
And: you put a file-system (maybe one rather specific to linux) on a disk-partition - you don't format it with linux...
It has been pointed out that there is no way to set permissions on vfat. But you can mount it to appear as it having permissions with the umask option.

Last edited by jomen; 03-01-2006 at 06:09 AM.
 
Old 03-01-2006, 06:19 AM   #6
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,594

Rep: Reputation: 124Reputation: 124
If you really want to format it with any other file system, you first have to know which device is the right one (for example by attaching the memory stick and get the device name from /var/log/messages, might be /dev/sda1 or any other). The device has to me unmounted for the next step. Then an mkfs.xxxx /dev/sda1 should format your device -- be sure to give the right device name and decide which file system you want. There are several mkfs.* like mkfs.reiserfs mkfs.ext2 mkfs.xfs.
 
Old 03-01-2006, 06:47 AM   #7
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 54
...and if you use ext2 - pay attention to the -m switch to mkfs (reserved-blocks-percentage).
If you go with the default 5% of it will be usable to noone else than root - which doesn't make much sense on a usb-stick
 
Old 03-01-2006, 09:50 AM   #8
karpa
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks I managed to format, see below:
kenneth@ubuntu:~$ su
Password:
root@ubuntu:/home/kenneth# mkfs.ext2 /dev/sdb
mke2fs 1.38 (30-Jun-2005)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
32000 inodes, 128000 blocks
6400 blocks (5.00%) reserved for the super user
First data block=1
16 block groups
8192 blocks per group, 8192 fragments per group
2000 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

I have one problem left, I logged in as root, changed permission to 755 and transfered some files in external memory stick, but when I try to run an executable file directly from Memory USB it does not run, I even tried ps -A to see if the process is running. Same file run ok directly from desktop
 
Old 03-01-2006, 10:03 AM   #9
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,594

Rep: Reputation: 124Reputation: 124
Quote:
Originally Posted by karpa
6400 blocks (5.00%) reserved for the super user

I have one problem left, I logged in as root, changed permission to 755 and transfered some files in external memory stick, but when I try to run an executable file directly from Memory USB it does not run, I even tried ps -A to see if the process is running. Same file run ok directly from desktop
First, you have some space reserved for root like jomen wrote that will be not accessible for normal users.
Second, look in the mount options -- maybe your memory stick is mounted with the "noexec" option which will prevent you from executing files from there.

PS: Just noticed that you gave sdb as argument and the program complained about this. I don't know if this is part of the problem, guess not. Usually you would give a specific partition I think like sdb1.

Last edited by titopoquito; 03-01-2006 at 10:05 AM.
 
Old 03-01-2006, 02:45 PM   #10
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 54
I think you did a few things wrong:
First the -m switch was missing, so now you can only access 95% of the memory if you are not root - but if that is what you desired - ok.
Second - you made a filesystem to the entire device instead of making it to the partition (the first and only one on the stick)
I would be surprised if this actually works...
Quote:
root@ubuntu:/home/kenneth# mkfs.ext2 /dev/sdb
mke2fs 1.38 (30-Jun-2005)
/dev/sdb is entire device, not just one partition!
There was a partition on that device - which had the vfat filesystem on it.
This one you change to ext2 - not the entire device!
It is the same as your harddisk - you dont make a filesystem to /dev/hda - you make one to /dev/hda1 or /dev/hda2 and so on.
the sequence would be:
(while the stick is not mounted)
fdisk /dev/hdb -> make one partition there
(or use: cfdisk /dev/hdb for an easier to use interface)
mkfs.ext2 -m 0 /dev/hdb1
 
Old 03-02-2006, 05:48 AM   #11
karpa
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
when you partition, which do you use:

1 Bootable? yes or no
2 FS TYPE (which i need to run exe directly from there)
3 Part Type? Primary or Logical

Thanks
 
Old 03-02-2006, 05:59 AM   #12
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 54
1. need not be
2. running exe - I assume you want to use it with windows - so chose a filesystem windows can handle - and the partition type accordingly: this would be
0C -> for W95 FAT32 (LBA) or
0B -> for W95 FAT32
3. primary
 
Old 03-02-2006, 06:11 AM   #13
karpa
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
When I set as primary, i get this error

WroNo primary partitions are marked bootable. DOS MBR cannot boot this.e.
Toggle bootable flag of the current partition

I set it as bootable, and i managed, I have full permissions 755 and still can't run exectable files.

The file properties are that i am trying to run are:
TYPE: executable
LOCATION: media/USB/kenneth
MIME TYPE: application/x-executable


Nore: I only need the USB memory stick for the Linux PC's, so I can run the same exe file at work on the Linux PC

Last edited by karpa; 03-02-2006 at 06:35 AM.
 
Old 03-02-2006, 06:26 AM   #14
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 54
Do you want to boot from it? - if yes set a/one partition bootable, else ignore - or just try and see...
 
Old 03-02-2006, 06:55 AM   #15
karpa
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
No i don't want to boot from it, all i want to do is run an exe file, which will create some text files in the usb memory itself

Note: When I put the all the contents of the External momory stick on desktop, all works fine but I would like to run it directly from USB so I carry the Memory stick from one Linux PC to another.

Thanks for you help

Last edited by karpa; 03-02-2006 at 07:04 AM.
 
  


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
change permission alma Linux - Newbie 5 10-28-2005 10:17 PM
how to change the file permission ?? AK prince Slackware 17 08-05-2005 12:16 PM
Why I cannot change permission on /etc/sudoers? mikeshn Linux - Software 1 01-06-2005 11:26 AM
chmod permission change? tidasu Linux - Newbie 7 08-30-2004 06:02 PM
How do I change permission many at a time? akihandyman Mandriva 1 08-26-2004 10:40 PM


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