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-23-2010, 11:06 AM   #1
sungchoiok
Member
 
Registered: Oct 2010
Posts: 30

Rep: Reputation: 1
Chmod is acting strange


I'm trying to change the restrictions to some normal text files and their result is not what is expected.

For example, when I put:

chmod 000 testfile.txt

on a file that is

-rwxrwxrwx,

it instead becomes

-r--r--r--.

It doesn't matter whether I do it with a root or the owner of the file, the result is the same.

Also, putting

chmod u-rwx testfile

results in the file becoming, again,

-r--r--r--.

Also, some doesn't have any effect, such as

chmod o-r testfile.

Even if I do this, the result is the same -rwxrwxrwx.


What is happening?

Thank you in advance...
 
Old 10-23-2010, 11:21 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
This file is probably on filesystem that does not support chmod. Chmod work only on ext2/3/4, etc. You can check your filesystem by "mount" command.
 
Old 10-23-2010, 01:12 PM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Why are you trying to give a file permissions that mean no-one can read it, not even the creator or root ? I think that chmod is behaving correctly here.
 
Old 10-23-2010, 05:51 PM   #4
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
That was only example. He even can't do "chmod o-r testfile". And, at least on Ubuntu, removing all permissions is allowed, root bypasses checking them. He definitely can't remove read permission from this file and permissions for user, group and others depend on each.

@sungchoiok:
Check if this behavior also concern other files in this directory. And as I suggested earlier check type of filesystem.
 
Old 10-23-2010, 09:36 PM   #5
sungchoiok
Member
 
Registered: Oct 2010
Posts: 30

Original Poster
Rep: Reputation: 1
Reply

Thank you for the generous replies..
At least, knowing that I'm not doing something completely stupid is comforting



There are five mounts, which are hda1, hda2, hda3, hda5, and sda1.
The first two 'hda's have my Windows 7 OS and the type is NTFS, so my DSL (Damn Small Linux) cannot even write to it.

The hda5 and sda1 is FAT. One is FAT32 and one is FAT, in my belief; I'm not at my computer right now, so I don't exactly know. Anyhow, I tried the same commands (and various others which I have not mentioned) and the results are more or less the same... either the files becoming, with some combinations, -r--r--r-- or with others, -rwxrwxrwx.


It's not a particulary important function, since I'm the only one using the computer and the members of my family (who are distrustful, lol) would gasp at a monitor filled with colorful text and no GUI, but nonetheless, it would be better to have them for practice, because I want to know more about Linux!


Once again, thank you!
 
Old 10-24-2010, 02:22 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
the very very old fat ( 16 bit for win95 )
or the newer ( 1998) fat32 DO NOT support file permissions
NOR dose the ntfs partition format
there is no way to change them because they DO NOT have any permissions !!
 
Old 10-24-2010, 11:11 AM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
You can't change permission on FAT or NTFS with chmod, but during mounting you can choose owner, group and permissions for all files on given partition. Read proper section of "man mount".
 
Old 10-24-2010, 04:14 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
there is no mount options on a "live" dsl cd

however a good question would be WHY are there fat and fat32 partitions on a windows7 ( 64 bit) os default on new hardware
or 32 bit on a vista upgrade

a very small HP or dell"recovery" partition yes but....

and why is the OP using dsl on a machine that has win 7 on it

replacing windows98 with DSL is onething
 
Old 10-25-2010, 04:23 PM   #9
sungchoiok
Member
 
Registered: Oct 2010
Posts: 30

Original Poster
Rep: Reputation: 1
Hmm. I take that you are "comdemming" me for installing Windows 7 on a FAT partition, but I never claimed that I did such a thing; the disk that has my Windows OS is NTFS.

Also, the FAT32 hard drive is the 5 GB partition that I made that is used by the Linux, not Windows.

Also, I decided to use the CD-booting Linux since I felt not ready to use a "full-scale" one.. any better alternatives you give me will be welcomed!



"You can't change permission on FAT or NTFS with chmod"... so what file system?


Thank you~

Last edited by sungchoiok; 10-25-2010 at 04:25 PM.
 
Old 10-25-2010, 07:49 PM   #10
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Linux mainly use ext2, ext3 or ext4. If you have no data on that 5GB FAT32 partition you can reformat it by 'mkfs.ext2' Double check if you set proper device name, to not destroy your Windows.
 
Old 10-26-2010, 01:12 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,361

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Linux & MS use different file permissions models. Don't try to use Linux chmod on any MS formatted disk ie FAT, NTFS.
Ususally on Linux the current default FS type is ext3, so the cmd

mkfs.ext3

would be used.
Some of the distros are now on ext4.
http://linux.die.net/man/8/mkfs.ext3
 
  


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
Sendmail Acting Strange Atulmishra Linux - Server 1 11-06-2007 10:41 PM
Wacom acting strange Yoda3114 Ubuntu 9 03-29-2007 02:52 AM
CD-Rom acting strange. bilko9070 Linux - Hardware 0 01-11-2006 04:52 AM
Avidemux2 acting strange alitrix Linux - Software 0 12-15-2004 10:55 AM
suse 9.1 acting strange ozzytx Linux - General 1 08-29-2004 09:41 PM

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

All times are GMT -5. The time now is 12:54 AM.

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