Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a bootable linux thumb drive meant to deploy linux OS images and I've been having problems with the thumb drive occasionally changing the /dev/sd device it mounts as, wreaking havoc with the install scripts. Is it possible to force the linux system on the thumb drive to always detect the thumb drive as a specific sd device? My thumb drive usually mounts as sda, although a thumb drive image I was using as a reference always comes up as sdb.

I did some research and it looks like I might be able to do something with grub or udev, but I wasn't able to find specific enough information to get what I wanted. Another interesting thing I saw with udev is that you don't necessarily have to use /dev/sd devices, one website had an example with /dev/thumb. It would be ideal to have the thumb drive be detected as something like that so that all sd devices are actual devices in the host machine.

The thumb drive has a normal (i.e. not modified live cd, an actual install targeted at the drive) install of CentOS 5.8.

So my question is: is it possible to force linux to always detect a specific hardware device on a specific block device?

Thanks in advance for your responses.

share|improve this question

migrated from stackoverflow.com Oct 29 '12 at 12:42

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

The device_mapper solves this problem, to some extent. You probably want to use /dev/disk/by-uuid (or possibly /dev/disk/by-path).

share|improve this answer
add comment

You need to look into how to add a udev rule for your device, so that it always creates a device node at /dev/thumb based on your disk uuid.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.