LinuxQuestions.org
Visit Jeremy's Blog.
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, 12:06 PM   #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, 12:21 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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, 02:12 PM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
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, 06:51 PM   #4
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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, 10: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, 03:22 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,827

Rep: Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409
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, 12:11 PM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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, 05:14 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,827

Rep: Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409
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, 05: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 05:25 PM.
 
Old 10-25-2010, 08:49 PM   #10
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
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, 02:12 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
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


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


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