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:


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?

  • You could try adding a symlink there manually. It may persist at best until next reboot, but still. – mirabilos Feb 28 '14 at 17:04
  • What distro are you using? – Graeme Feb 28 '14 at 17:58
  • @mirabilos Symlink was the solution for my problem. Thanks a lot, pal. – Nic61629 Mar 7 '14 at 0:01
  • @Graeme I am using Ubuntu 13.10 and Fedora 17. – Nic61629 Mar 7 '14 at 0:01
  • Ok, those both use udev, so my answer should put you on the right track. – Graeme Mar 7 '14 at 0:07

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 command grep -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:

ENV{DEVTYPE}=="disk",   ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \

ENV{DEVTYPE}=="partition",  ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \

There are two possibilities here (apart from the one where your system doesn't use udev at all):

  1. You have no line similar to this and you need to create one.
  2. You do, but it just doesn't work for you disk.

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:

udevadm info --name=/dev/sdb --query=property

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-empty ID_BUS and ID_SERIAL). The next part creates a symlink with its name containing ID_BUS and ID_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):

udevadm control --reload-rules

Then plug in your device again. If this doesn't work, you can always try rebooting (in fact this may be safer anyway).

  • Superb! Your answer solved my problem. Learned a lot from it. Thank you very much. – Nic61629 Mar 7 '14 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.