How to change a file's type in Linux. (Solved ... kind of)

Discussions Regarding Software

Moderator: Moderators

How to change a file's type in Linux. (Solved ... kind of)

Postby chsims1 » Thu Oct 30, 2008 19:53

I have a few mp3s on a networked drive that won't play & which I can't delete (even as root). If I look at the file permissions with ls -l then it two things are obviously wrong. Firstly the owner & group are numbers (no idea where from), and secondly the first bit of the permissions (filetype) is set to p, b or ?. I can't chown the files to root ownership, or delete them. I have searched, but with no luck. What ostensibly looks to be a simple thing to change is obviously more complex than I thought. Any ideas please people?
Last edited by chsims1 on Sat Nov 01, 2008 10:34, edited 1 time in total.
chsims1
Growing Hen
 
Posts: 128
Joined: Wed Mar 07, 2007 8:53
Location: UK

Re: How to change a file's type in Linux.

Postby chickpea » Thu Oct 30, 2008 21:51

chsims1 wrote:I have a few mp3s on a networked drive that won't play & which I can't delete (even as root). If I look at the file permissions with ls -l then it two things are obviously wrong. Firstly the owner & group are numbers (no idea where from), and secondly the first bit of the permissions (filetype) is set to p, b or ?. I can't chown the files to root ownership, or delete them. I have searched, but with no luck. What ostensibly looks to be a simple thing to change is obviously more complex than I thought. Any ideas please people?



Wrong, owners and groups are numbers. Your user is probably 1000.

Nevertheless, ls -l should not normally output the uid/gid, but the name. Permissions and filetype are two different things.

so you can't chmod them, but ostensibly these files are on a remote drive, do you have root permissions on the remote drive? Or are you merely logged in the remote drive as a normal user?
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC

Re: How to change a file's type in Linux.

Postby chsims1 » Fri Oct 31, 2008 9:19

What I should have said was that the owner and group of these particular files is totally different from all the rest. I'm not particularly concerned about that, I was merely highlighting the differences between playing & non-playing files.

Yes, I do have root access to the networked disk: indeeed I have now physically attached it to a USB port on my PC to try & sort things out more conveniently. I have checked that I have write/read access.

Yes, I do realise the difference between permissions and filetype. These files do not have the correct filetype for mp3 files, which is why they will not play & presumably why I can't delete them. I would like to know how to reset the filetype if at all possible (I am doubtful whether that would recover the files), or just simply delete them. Thanks for any ideas.
chsims1
Growing Hen
 
Posts: 128
Joined: Wed Mar 07, 2007 8:53
Location: UK

Re: How to change a file's type in Linux.

Postby Stupot » Fri Oct 31, 2008 15:40

Did you try to chmod them as root?

Code: Select all
# chmod 777 <file>


If you can't change their permissions as root, then you can't change their permissions at all. What is the filesystem that the hard drive is where these files are located? I assume it's compliant with unix permission standards (i.e. NOT NTFS), or else I wouldn't think you would be having this problem.

You you provide us with the output of ls -l so we can see things a bit more clearly?
Stupot
Sagely Hen
 
Posts: 1549
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: How to change a file's type in Linux.

Postby chsims1 » Sat Nov 01, 2008 10:33

Just to close the thread .....well the problem was a bit more serious than I originally thought. It wasn't just my mp3 files which had become corrupted. The disk was attached to a NSLU2 running Debian and system files were damaged too. Easiest just to wipe the disk clean: luckily everything was backed up. Still don't know how to change a filetype though :D
chsims1
Growing Hen
 
Posts: 128
Joined: Wed Mar 07, 2007 8:53
Location: UK


Return to Software in General

Who is online

Users browsing this forum: No registered users and 1 guest