LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2009, 01:07 PM   #1
Bill Johns
Member
 
Registered: Mar 2005
Distribution: Zenwalk for now
Posts: 82

Rep: Reputation: 15
A question about file permissions


I know what the r and w stand for, whats the b?

brw-rw---- these are the permissions for fd0 in dev directory.

I want to copy fd0 and intall in my other system, if I go to cp it, all that happens is it trys to copy what ever is in the floppy drive. I want to copy the driver.
Need to know how do take away the executable permissions and then to put them back on. How does this work?
Thanks ahead of time.
 
Old 05-08-2009, 01:11 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by Bill Johns View Post
I know what the r and w stand for, whats the b?

brw-rw---- these are the permissions for fd0 in dev directory.

I want to copy fd0 and intall in my other system, if I go to cp it, all that happens is it trys to copy what ever is in the floppy drive. I want to copy the driver.
Need to know how do take away the executable permissions and then to put them back on. How does this work?
Thanks ahead of time.
'b' stands for "block device node". Those are not normal files, they represent devices. You usually shouldn't be interacting with the files inside /dev unless you know what you are doing (tm).

What takes me to my next question: what are you exactly trying to do with the contents of the floppy disk?
 
Old 05-08-2009, 01:22 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The b indicates it is a block "device" file. Copying it would not copy the "driver". The way to make a device file is with use of the mknod command.

Say you have the following:
brw-rw---- 1 jlightne floppy 2, 0 Apr 12 22:12 /dev/fd0
Notice that the fields after floppy (2,0) are NOT size as they would be in a normal file. These are the major,minor number that describe the device.

To create a device with same major/minor on another system you would type:
mknod /dev/fd0 b 2 0

Note that you can create a device file with mknod but this has no meaning if the underlying driver is not already installed on the system on which you create it. You'll get messages like "device not found".

You use the chmod command to set permissions on files but for device files the permissions may be overridden by the driver or the utility that accesses the device. Also the mknod command has a flag to set permissions (mode) at creation.

Type "man mknod" and "man chmod" for more information on the two commands.
 
Old 05-08-2009, 11:26 PM   #4
Bill Johns
Member
 
Registered: Mar 2005
Distribution: Zenwalk for now
Posts: 82

Original Poster
Rep: Reputation: 15
I goofed up and did a copy like this. Since its been along time since fooling with linux and not studying first. I wanted to copy mouse to the floppy drive. Yeah I now know how to do it. But I issued this command. Cp mouse fd0 so I figured I messed fd0 up and just deleted it, now I want to get an fd0 back in it. So is it not a driver just a link to the driver? How to get it back?
 
  


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
Linux file permissions question RomeoJava Linux - Newbie 6 11-27-2008 03:17 AM
File/Directory Permissions Question nyle Linux - Newbie 2 05-08-2008 01:57 PM
Question about linux file permissions (+ in mode) bagpussnz Linux - General 1 08-06-2007 07:55 PM
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 12:00 PM
Folder/File Permissions Question? gsmonk Linux - General 8 07-20-2003 03:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:28 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
Open Source Consulting | Domain Registration