Device Files names and location


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Device Files names and location
# 1  
Old 12-01-2008
Device Files names and location

HI there. I am studying System administration right now and am stuck on a question that I have failed to find the answer for in my book.

The question is: Do device files need to be in the /dev directory and to they need to follow a naming convention?

My answer (so far) is that since the kernel commnicated with device files, it needs to know where they are located, so I would imagine that yes they do need to be in the /dev directory. And as a rule of thumb there are conventions that need to be followed as "best practices" such as fd, lp etc, but I could make the name whatever I wanted.

I have tried to solve this myself by:
Reading the section in the book again (and again)
Searching other forums and resource sites
played around on my system to test it myself
i.e.
1. cd /home/temp
2. sudo mknod mydev c 136 2
3. echo "testing" > /home/temp/mydev
--> Nothing happens here which would seem to re-enforce my answer that device files do need to be in the /dev dir but ca nstill be named whatever I want

So, this is where I am confused. I have attempted to solve this myself, and don't simply want the answer and that's it, but some help, clarification, point in the right direction etc.

I'm just spinning my wheels so any support would be appreciated. I have emailled my prof as well, and am just waiting as well, so thought I would post the same thing here!
# 2  
Old 12-01-2008
I do see that Rule # 6 in the forums says "no clasroom post" and yes, this is a classroom post, but as I am the only person taking this correspondence course, and as I do not simply want the answer (I am trying to get this one on my own), I thought this would be acceptable. Hope it's ok.
# 3  
Old 12-01-2008
I guess if someone wrote a kernel to use a different location it would work. Let us know what the prof says.
# 4  
Old 12-02-2008
Actually, the kernel do not care neither need to know where the device files are located. Devices files can reside elsewhere as Solaris demonstrates (they are under /device, not /dev).

On the other hand, userland applications need to locate the device files in a predefined and often standard location, one of the reason why Solaris creates symbolic links there.
# 5  
Old 12-02-2008
Sure, so during kernel build thought correct?
# 6  
Old 12-02-2008
Sorry, I don't understand your question.
# 7  
Old 12-02-2008
No problem, I'm confused by this.

I'm not sure how a device would work when it's not located where everything expects it to be.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

2. Android

Device Names on Android

Hi, I have a program that logs serial port data. In order to do so it requires the full device name in linux (e.g. /dev/ttyUSB0) and a baudrate. Does anyone know how I can find out the device name in the terminal? I am trying to port this application to Android and cant figure it out. ... (22 Replies)
Discussion started by: fedora18
22 Replies

3. Linux

Get all the files from a FTP location with previous week's dates in the file names using Linux

I have a weird requirement where I have to get the files from a FTP(Lets say FTP1) location and place it on my current FTP(Lets say FTP2) location. The issue is, these are daily files (in a pattern Sales_YYYYMMDD_report.csv) and are placed every day on FTP1 and my process usually runs on Monday(eg.... (2 Replies)
Discussion started by: dhruuv369
2 Replies

4. Shell Programming and Scripting

Help with copying the list of files from one location to other location

A) I would like to achive following actions using shell script. can someone help me with writing the shell script 1) Go to some dir ( say /xyz/logs ) and then perform find operation in this dir and list of subdir using find . -name "*" -print | xargs grep -li 1367A49001CP0162 >... (1 Reply)
Discussion started by: GG2
1 Replies

5. Shell Programming and Scripting

How to find a existing file location and directory location in Solaris box?

Hi This is my third past and very impressed with previous post replies Hoping the same for below query How to find a existing file location and directory location in solaris box (1 Reply)
Discussion started by: buzzme
1 Replies

6. Shell Programming and Scripting

Help on Moving files from one location to another location

Hi, I am new to unix and shell scripting. Please help me in resolving the below issue. In my shell script I have a variable which stores the different files with the path. Now I need to move all the files one by one to another location. ---- 1.... (4 Replies)
Discussion started by: kpagadala
4 Replies

7. Shell Programming and Scripting

Shell Script for Copy files from one location to another location

Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
Discussion started by: allways4u21
2 Replies

8. Shell Programming and Scripting

Transfer files from one location to another location

Hi, i have to transfer of files of User1 located in Location1 to user2 located in Location2 using shell script. Please suggest me. (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

9. UNIX for Advanced & Expert Users

copy files from one location to similar location

I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure, say location 1, /home/rick/tmp_files/1-12/00-25/ here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Discussion started by: pharos467
1 Replies

10. UNIX for Dummies Questions & Answers

device location codes

what is meant by device location codes? what is their format and how can i identify the location of a device in redhat linux? (1 Reply)
Discussion started by: docaia
1 Replies
Login or Register to Ask a Question