I have a S2 SAMSUNG 320GB USB-HDD which I use in both Ubuntu 13.10 (Kernel 3.11.0-17-generic) and Fedora 17.
It works fine; I can read/write from/to them. Although, I am experiencing an issue with a software that deals with pen drive and other USB devices.
This program tries to list the available devices by running the following:
ls -l /dev/disk/by-id/usb*
and returns nothing.
So, I ran in terminal: ls -l /dev/disk/by-id/*
and got this:
ata-hp_DVDRAM_GT30L_KZEA6810820
ata-SAMSUNG_HM321HX_C5733G82AB0BPW
ata-WDC_WD3200BEKT-60V5T1_WD-WX81A50J4370
wwn-0x50000f00ab0b000b
wwn-0x50014ee20495cc9f
in /dev/disk/by-uuid
, my UBS-HDD is: 19ED-1878 -> ../../sdb
My external HD is, so, listed as "ata-SAMSUNG…." and can not be found as "usb*…".
I googled a lot about that. Found that editing /etc/fstab
or /boot/grub/grub.conf
would help me (haven't found anything related to my USB dev in grub.conf
nor fstab
). Or something like ZFS, zpool.. and even a tool that deals (only?) with the UUID, tune2fs.
So, is it possible to change /dev/disk/by-id/ata-SAMSUNG...
to ../../by-id/usb-SAMSUNG...
? And if so, how?
Best Answer
Ok I guessing this is a
udev
issue (most Linux distros use this by default), this is what creates the symlinks. You can fix this by add a new rule. I will give some info on this, but it is largely anchored in my own distro - Debian.First off, you need to find where your rules are. Debian has them in two locations -
/lib/udev/rules.d
and/etc/udev/rules.d
. If this is the case for you should only add/change the ones under/etc
as changing another location is more likely to lead to being overwritten by an update.Go to the rules directory and see if you can find the file(s) with the rules for creating the links under
disk/by-id
. The commandgrep -r disk/by-id/
is going to help here (though only run it in the rules directory to avoid searching other places). For me the file is/var/lib/rules.d/60-persistent-storage.rules
. Here are the lines that are creating the``disk/by-id/usb-*` links for me:There are two possibilities here (apart from the one where your system doesn't use
udev
at all):The lines might look like gibberish, but basically the first two (really one as the
\
is just a way of splitting long line) are for links relating to the disk itself, the other two are for its partitions.Hopefully running this command should make things less confusing:
This shows the names/values of all the properties of your device. Basically all the rule does is go through all the properties of each device and matches them against the first part of the line (eg the first looks for devices with
DEVTYPE=disk
, and non-emptyID_BUS
andID_SERIAL
). The next part creates a symlink with its name containingID_BUS
andID_SERIAL
.Anyway, what this boils down to is if you have
ID_BUS=usb
, you can probably go ahead and add the above rule. If not, you probably need to add specific rules for your device. Something like:I have guessed your
ID_SERIAL
from the question, if its wrong go ahead and put in the right one.The rules are probably best in a file of their own, something like
s2-samsung-usb.rules
in the directory you found at the start.Update: the below probably isn't necessary, just unplug and the plug the device in again - How to reload udev rules without reboot?
Once you are done, you can reload the rules with (unplug your device first):
Then plug in your device again. If this doesn't work, you can always try rebooting (in fact this may be safer anyway).