dmesg to find usb key in Linux?
7,735
Try this:
tail -f /var/log/dmesg
This will output the contents of dmesg
as it happens. While you have this running, plug your USB memory stick in and note what it says. If you get heaps of non-related stuff, try this:
tail -f /var/log/dmesg | grep USB
This will only show lines containing the word USB. Use Ctrl + C
to exit.
There is another answer here to a related question.
Related videos on Youtube
Author by
vuejs
Updated on September 18, 2022Comments
-
vuejs over 1 year
What exactly I must look for after a dmesg comand to find usb key? there are lots of entries with usb in them but which one?
-
don_crissti about 7 yearsWhat are you trying to accomplish ?
-
vuejs about 7 yearsI need the device nameof my usb so I can install Debian on it.
-
don_crissti about 7 years... run
lsblk -no name,label,tran
before and after inserting your key -
vuejs about 7 years@don_crissti lsblk worked, thanks, just need to see where it is in dmesg.
-
-
dirkt about 7 yearsNote however that grepping will remove all context that doesn't contain the word USB (in caps), and often this context is important. Once you've identified the place where interesting things happen, always look at the complete dmesg output at the appropriate place. (
less
has a search function). -
dirkt about 7 yearsWhy use
watch
(executes every 2 seconds) instead oftail -f
(executes when the output changes)? -
GAD3R about 7 years@dirkt You should be root to access the log file
/var/log/
-
dirkt about 7 yearsSo use
sudo
. You are doing admin work, you need root access, anyway. -
Jacob Degeling about 7 yearsYou are right:
less
is a much better way if you need to keep context information.