LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-09-2012, 05:46 AM   #1
Durque
LQ Newbie
 
Registered: Nov 2012
Distribution: OpenSuSE; Mint
Posts: 6

Rep: Reputation: Disabled
Cleaning up device drivers after USB memory stick


Greetings

I need to clean up system device drivers in a proper manner. Some USB-stick has been physically removed several times leaving orphaned device drivers. (As you will guess. System is currently running Linux Mint 11 Katya (/etc/issue) LiveCD).

In below listing, only /dev/sdf1 is active USB-stick. /dev/sdd1 and /dev/sde1 are orphans.

Code:
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
aufs                 1007M  991M   16M  99% /
none                  997M  660K  997M   1% /dev
/dev/sr0              4.0G  4.0G     0 100% /cdrom
/dev/loop0            642M  642M     0 100% /rofs
none                 1007M  172K 1006M   1% /dev/shm
tmpfs                1007M   14M  993M   2% /tmp
none                 1007M   96K 1006M   1% /var/run
none                 1007M     0 1007M   0% /var/lock
/dev/sdb1              68M   50M   15M  78% /media/23b07c85-4984-4b31-b849-889bcca7874c
/dev/sdb2              12G  9.4G  1.9G  84% /mnt/opensuse
/dev/sdd1              15G   18M   15G   1% /mnt/USB
/dev/sde1              15G   18M   15G   1% /mnt/USB
/dev/sdf1              15G   18M   15G   1% /mnt/USB
Here's what the system thinks is currently mounted. (Please note the last three entries.

Code:
$ cat /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
none /dev devtmpfs rw,relatime,size=1020836k,nr_inodes=213472,mode=755 0 0
none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev/sr0 /cdrom iso9660 ro,noatime 0 0
/dev/loop0 /rofs squashfs ro,noatime 0 0
tmpfs /cow tmpfs rw,noatime,mode=755 0 0
aufs / aufs rw,noatime,si=2d0d5fb1 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,relatime 0 0
none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0
none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
gvfs-fuse-daemon /home/mint/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=999,group_id=999 0 0
/dev/sdb1 /media/23b07c85-4984-4b31-b849-889bcca7874c ext4 rw,nosuid,nodev,relatime,barrier=1,data=ordered 0 0
/dev/sdb2 /mnt/opensuse ext4 rw,relatime,barrier=1,data=ordered 0 0
none /mnt/opensuse/proc proc rw,relatime 0 0
none /mnt/opensuse/sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /mnt/opensuse/sys/fs/fuse/connections fusectl rw,relatime 0 0
none /mnt/opensuse/sys/kernel/debug debugfs rw,relatime 0 0
none /mnt/opensuse/sys/kernel/security securityfs rw,relatime 0 0
none /mnt/opensuse/dev devtmpfs rw,relatime,size=1020836k,nr_inodes=213472,mode=755 0 0
none /mnt/opensuse/dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
none /mnt/opensuse/dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/sdd1 /mnt/USB vfat rw,nosuid,relatime,uid=999,gid=999,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/sde1 /mnt/USB vfat rw,nosuid,relatime,uid=999,gid=999,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/sdf1 /mnt/USB vfat rw,nosuid,relatime,uid=999,gid=999,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
Last mount was
Code:
$ sudo mount -o nosuid,uid=$(id -u),gid=$(id -g) /dev/sdf1 /mnt/USB
Current device drivers are:
Code:
$ ls -l /dev/sd*
brw-rw---- 1 root disk 8,  0 2012-11-19 21:37 /dev/sda
brw-rw---- 1 root disk 8, 16 2012-11-19 21:37 /dev/sdb
brw-rw---- 1 root disk 8, 17 2012-10-21 21:02 /dev/sdb1
brw-rw---- 1 root disk 8, 18 2012-10-21 21:02 /dev/sdb2
brw-rw---- 1 root disk 8, 19 2012-10-21 21:02 /dev/sdb3
brw-rw---- 1 root disk 8, 32 2012-11-19 21:37 /dev/sdc
brw-rw---- 1 root disk 8, 80 2012-12-09 12:34 /dev/sdf
brw-rw---- 1 root disk 8, 81 2012-12-09 12:34 /dev/sdf1
Any suggestions to how I can properly remove the noneused device drivers properly?

Durque

Last edited by Durque; 12-09-2012 at 06:05 AM.
 
Old 12-09-2012, 10:04 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Hi Durque, welcome to LQ!

Quote:
Any suggestions to how I can properly remove the noneused device drivers properly?
They are not drivers, they are either character files or links created by udevd for the purpose of marshaling hot plugged devices. Don't worry if they exist, they don't do any harm to the system nor do they consume an amount of processor load. If you will delete them as root udev will still create them for you when the need comes to use one.

As to the device records you called 'orphans' you may clean the udev data base if you want:
Code:
~# udevadm info --cleanup-db
Likewise they are not harmful and they are not eating up the processor. I often experience similar pseudo-nuisance when device is remove before the system is ready.

There are also times when the file system journal commits something that no longer exists (specially under ext4) so the solution is simply to run 'fsck' and the bad record will go. Usually 'orphaned' records disappear at next boot up.

Hope that helps.

Good luck.

Last edited by malekmustaq; 12-09-2012 at 10:07 AM.
 
1 members found this post helpful.
Old 12-09-2012, 04:21 PM   #3
Durque
LQ Newbie
 
Registered: Nov 2012
Distribution: OpenSuSE; Mint
Posts: 6

Original Poster
Rep: Reputation: Disabled
Excellent. Thanks. Your insight was highly appreciated. I'm quite at ease now to whether thisd good possibly hamper my system. Thanks again.

Durque
 
  


Reply



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
Ubuntu/Debian. An USB stick to get /dev/dvb Xeratul Linux - Hardware 2 05-04-2012 02:46 AM
usb stick - not /dev/sda1? Lunar_Lamp Slackware 10 02-26-2006 01:21 PM
USB: Memory Stick: no /dev/sda1 sysbox Linux - Hardware 6 08-09-2005 11:29 PM
bad block dev when mounting a usb stick scottsteibel Mandriva 1 04-28-2004 10:26 AM
USB 2.0 memory stick mount: wrong fs type, bad option, bad superblock on /dev/sda1, o olivier.riff Linux - Hardware 2 11-12-2003 08:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:12 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