LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-17-2005, 09:44 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Question Managing the /dev directory


While reviewing my CUPS logs today I noticed that a bunch of printer devices are loaded by CUPS:

/dev/ttyS0 through /dev/ttyS31
/dev/usb/lp0 through /dev/usb/lp15

I suspect CUPS is merely reading the device list from /dev.

I'm running some old boxes here. One box has only two USB ports and IIRC they are USB 1.0. The other box also has two USB ports but I think they might be USB 2.0 compatible, although I am unsure because I never use the ports.

I don't have any USB devices here and I likely am not going to have any for these boxes. My only two external peripherals are a parallel port printer and a parallel port scanner. But even if I did opt for some USB devices I only have two ports, not 16.

I also surely do not have 32 serial ports available on either box.

I'm thinking I'd like to disable the overhead attached with all of these extra devices. I'm unfamiliar with all there is to know about the /dev file system and I'm wondering whether I'll be okay if I simply delete all the unnecessary devices. Or perhaps, is there an easier way to disable them from within a config file? Or do I need to recompile the kernel?

I suspect that the unnecessary devices probably produce no impact per se on my boxes, but with old hardware every little tweak seems to always help---even if only mentally .

Your thoughts and ideas are appreciated.
 
Old 10-18-2005, 01:14 AM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,768

Rep: Reputation: 204Reputation: 204Reputation: 204
Re: Managing the /dev directory

Quote:
Originally posted by Woodsman
While reviewing my CUPS logs today I noticed that a bunch of printer devices are loaded by CUPS:

/dev/ttyS0 through /dev/ttyS31
/dev/usb/lp0 through /dev/usb/lp15
Odd. /dev/ttyS* are usually COM ports, not parallel ports...

Quote:
Originally posted by Woodsman Or do I need to recompile the kernel?
Yeah, probably best option. Upgrade to 2.6 as well because that will enable udev support and eliminate lots of unused /dev entries.
 
Old 10-18-2005, 06:16 AM   #3
bluesgone
LQ Newbie
 
Registered: Jul 2005
Location: Guangzhou,China
Distribution: aix5.3
Posts: 11

Rep: Reputation: 0
Re: Re: Managing the /dev directory

Quote:
Originally posted by rkelsen
Odd. /dev/ttyS* are usually COM ports, not parallel ports...



Yeah, probably best option. Upgrade to 2.6 as well because that will enable udev support and eliminate lots of unused /dev entries.
-------------------------------------
But how can we disable then???

Can rm command do the jobs???

thank you.
 
Old 10-18-2005, 06:30 AM   #4
leif81
LQ Newbie
 
Registered: Aug 2004
Location: kingston, canada
Distribution: Fedora
Posts: 20

Rep: Reputation: 0
If you remove /dev devices you have a good chance of breaking your system in the process. If you are lucky enough not to break your sysytem you still haven't gained much except an uncluttered /dev directory. I would leave them well alone, they're not hurting anyone

And yes, if you upgrade to a udev capable kernel you will get much fewer unused device listings.
 
Old 10-18-2005, 08:20 AM   #5
Godsmacker777
Member
 
Registered: Oct 2004
Posts: 52

Rep: Reputation: 15
you can compile support into the kernel as modules, leaving them unloaded until you need them..or taking out support for them entirely.

The devices wouldn't even be created (at least that seems logical to me). I don't believe ttysx has anything to do with the parallel port (which is /dev/lpx), if I'm not mistaken. You can set serial support modular as well if you wish..


[EDIT] BAD idea to start removing stuff from /dev/ ...

part of having root privledges is being able to break things..the system is trusting YOU to know what you're doing. Do the research before deleting random files

(I'm talking in general here..not specifically to you anymore - you came to a forum, good choice)

Last edited by Godsmacker777; 10-18-2005 at 08:23 AM.
 
Old 10-18-2005, 12:32 PM   #6
wlewis
LQ Newbie
 
Registered: Jul 2002
Distribution: Linux from Scratch
Posts: 10

Rep: Reputation: 0
Cleaning out /dev

When you recompile the kernel and enable udev, you will mount a ramdisk on top of /dev. So all your device files will still exist on your actual disk, it's just that you won't be able to see them. And instead of getting a massive list of possible devices, you will only see a list of devices actually exported to userland from the kernel. Another dependency is the hotplug scripts, available from ftp.kernel.org. When you plug in a new device (e.g. a USB mouse or keyboard or thumbdrive), that will show up (if everything is configured correctly) in the /dev directory magically. But, as with all software, the best rule of thumb is that if it ain't broke, don't fix it. And it seems like everything is working for you.

Will
 
Old 10-18-2005, 04:20 PM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Quote:
Odd. /dev/ttyS* are usually COM ports, not parallel ports...
I agree. Perhaps this one anomaly is due to CUPS.

Quote:
Upgrade to 2.6 as well because that will enable udev support and eliminate lots of unused /dev entries.
For myself, I'm no kernel guru and I have no desire to become one. Recompiling is okay and I've done that to provide the 2.4.x kernel I need/want for my old boxes. I don't do RAID, LVM, and a slew of other things my older boxes do not support. I don't even use the hotplug rc.d script because there is no need. My boxes are "old," static, and to many young folks and bleeding edge types, just plain boring.

I still use the 2.4.x kernels and likely I will not change until after P.V. officially sanctions the 2.6.x series. The simple reason is I have other things to do. I realize many people use 2.6.x without problems, but I've read contrary stories too. With my old boxes, 2.4.x works just fine.

Quote:
If you remove /dev devices you have a good chance of breaking your system in the process.
This is something I suspected. Possibly long ago in a galaxy far away I once tried this and my subconscious is reminding me not to go there and hence, I posted my question here instead.

Quote:
And instead of getting a massive list of possible devices, you will only see a list of devices actually exported to userland from the kernel.
Can I do this with the 2.4.x kernel? Been a while since I recompiled my current kernel.

Quote:
And it seems like everything is working for you.
Yes, everything works, no complaints, just curious about ways to reduce the "clutter." That all of these unnecessary devices are created seems wasteful to me and if there is a way to reduce that clutter with the 2.4.x kernel then I'd be grateful to know.
 
Old 10-18-2005, 08:44 PM   #8
Godsmacker777
Member
 
Registered: Oct 2004
Posts: 52

Rep: Reputation: 15
udev is a new device management system available to the 2.6 kernel series. I believe devfs has been deprecated..

essentially is nicer and newer. I have yet to have ANY problems on my system with any 2.6 kernel. Overall there is a noticable difference in performance between 2.4 and 2.6..things are a bit "cleaner".

Quote:
For myself, I'm no kernel guru and I have no desire to become one. Recompiling is okay and I've done that to provide the 2.4.x kernel I need/want for my old boxes. I don't do RAID, LVM, and a slew of other things my older boxes do not support. I don't even use the hotplug rc.d script because there is no need. My boxes are "old," static, and to many young folks and bleeding edge types, just plain boring.
I don't think you have to be any guru to compile your kernel, though one should be educated. I believe compilng the kernel is part of the essence of linux and unix in general. You have the power to set it up as you wish, you can tailor the system to your needs. I'm no young "ricer" though I take pride in my system and how it runs. I guess it's also about expanding my experience.

Well anyway..compiling a new kernel - or rather tailoring a kernel to your needs - is not all that difficult, but it's pretty damn beneficial in the long run. Good luck.
 
  


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
no files in /dev directory balajia82 Linux - Software 1 10-12-2005 08:18 PM
/dev directory Dave-Bowskill Programming 0 09-19-2004 11:52 PM
/dev directory class_struggle Linux - Newbie 2 07-13-2004 12:30 PM
/dev directory nny0000 Slackware 3 02-03-2004 06:37 PM
/dev directory phishman3579 Slackware 3 12-02-2003 04:18 PM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration