Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using 12.04. My hard drives usually comes as: sda, with sudo blkid and if I plug-in any USB drive, they comes as: sdb, sdc etc; after sda. That's fine.

But problem arises after I restart my laptop with connecting those USB drives. They alter and comes first and hard drive goes to the end, like: sudo blkid shows, sda, sdb for USB drives and sdc for hard drives. It's making problem to mount with /etc/fstab.

I couldn't find any solutions for this. I would like to have any USB drives after my system hard drives, as in Windows. Please, help me at this point.

share|improve this question
    
Is the computer's BIOS set to boot from USB first? –  user68186 Oct 3 '12 at 16:20
    
You mean from usb live? –  Anwar Shah Oct 3 '12 at 16:23
    
To user68186 - My first boot is CD Rom, then Hard Drive, then Network, and the last is from USB –  raihanchy Oct 6 '12 at 11:52
    
To Olive - I can't catch u, wht d u mean by USB Live? But the problem arises when restart my Laptop with plugged-in my USB drives/Camera/Mobile etc. –  raihanchy Oct 6 '12 at 11:55
add comment

2 Answers

When editing devices in /etc/fstab the suggested method is not to use sd[a-z] naming. Rather, you should use the UUID of the device. This will mean that your mounted devices will not be affected by what device is designated as sda or sdb and so on.

A great guide to learning how to use UUIDs to automatically mount drives in /etc/fstab can be found here: http://www.cyberciti.biz/faq/linux-finding-using-uuids-to-update-fstab/

share|improve this answer
    
Thnx a lot 4 ur reply. Could u pls post the format, the way I should write in fstab with Device ID. –  raihanchy Oct 3 '12 at 19:13
1  
If you take a look at the link that I put in my answer that should give you what you need. It is a very thorough guide. If you need help with it specifically let us know –  prateek61 Oct 4 '12 at 2:09
add comment

First, look in your BIOS for a boot ordering. Despite the fact that this is usually referred to as "boot order", it also affects the enumeration post-boot. BIOSes vary greatly in UI, even ones by the same vendor, so I can't tell you exactly where to look, but if you could post the make and model of the laptop, that'd help.

Second, as prateek61 mentioned, you shouldn't use dev node names in fstab, because they can change. Use UUIDs. I myself prefer using labels (man e2label for ext* filesystems) because they actually mean something, but UUIDs are much more likely to be unique. You could potentially run into a problem where some random disk you add has the same label as one of your system disks, but this is kind of unlikely if you, say, prefix it with a hostname.

share|improve this answer
    
I m using a bit older laptops: HP 2133 and Acer 1310. I checked my BIOS though. It's boot order to CDRom first, then Hard drive, then others. –  raihanchy Oct 3 '12 at 19:16
    
Even with UUID, I have to specify each of my drives individually. But I am looking automation, like Windows usually does - all of hard drives should at the beginning and then USB Drives. I have other desktop,laptop and tablet PC as well. All might will have same problem, if I wish to use Uubuntu 12.04. Thnx again –  raihanchy Oct 3 '12 at 19:20
    
Sometimes the BIOS will have a separate hard drive boot order section, where you can change the order of the hard drives. It's not clear whether a USB key is a "hard drive" or an "other". I don't understand your second comment. Please clarify why order matters. And how would you not list them individually in fstab? This happens even using sd* devnodes, no? –  nfirvine Oct 3 '12 at 20:25
    
To nfirvine - Thnx 4 ur comment. My BIOS order is fine,I believe. 1st is CD Rom,2nd Hard Drive, then Network and the last is USB. –  raihanchy Oct 6 '12 at 11:58
    
To nfirvine - about 2nd comment. See in Windows usually we have C, D, E drives for the Hard Drives. And when plugged-in some other drive devices (USB Camera,Mobile, etc), they appeared after hard drives letters, say F,G,H,.. –  raihanchy Oct 6 '12 at 12:00
show 2 more comments

Your Answer

 
discard

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

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