fstab with uuid

October 10th, 2007 mysurface Posted in Admin, blkid, ls, vol_id | Hits: 300524 | 87 Comments »

When linux system starts, auto mounting partition will be done by refering to /etc/fstab. The file /etc/fstab will list down how you like the system to mount your partition. For examples,

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
   /dev/sda1      /media/sda1     vfat    default,umask=077,gid=46  0       0

/dev/sda1 is the device, the number will be change depend on the order of your hard disk that inject to your motherboard. /media/sda1 is the mount point, where the place you access the data of your disk storage. vfat is the file system’s type. Next is the list of mount options, carry on is dump and pass option.

Mount with device path has problems when you have multiple hard disk, and the order of hard disk changed may cause the file system failed to mount. Therefore later days of fstab entries has been modified to identify by uuid,

UUID=4706-0137      /media/sda1     vfat    defaults,umask=007,gid=46         0       0

UUID stands for Universally Unique Identifier, it gives each filesystem a unique identifier. With uuid, you no need to worry about the reordering of hard disk anymore.

So how to check the device’s uuid?

You can find all detected device by uuid with ls

ls -l /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 2007-10-10 20:30 4706-0137 -> ../../sda1
lrwxrwxrwx 1 root root 10 2007-10-10 20:30 497c771b-63fe-461f-ad7d-0bef9a6ba718 -> ../../sda5
lrwxrwxrwx 1 root root 10 2007-10-10 20:30 ce7b6c5d-c66a-4fc8-9638-72f62820f422 -> ../../sda3

Or if you wanna check on more details on the device,

sudo vol_id /dev/sda1

or this

blkid /dev/sda1
/dev/sda1: UUID="4706-0137" TYPE="vfat"

87 Responses to “fstab with uuid”

  1. Hello there!.. how are you?… I know this is off topic nad I don’t even know what Linux is, but I just want to say thank you for visiting WEBVH1.com :)

    By the way, what is Linux?…

  2. [...] to Linux By Examples for the initial howto. Posted in Linux, Shell, Short Tip, [...]

  3. great tip. I like the idea that you can call mount your root partition with simply: LABEL=Root too.

  4. Thanks for writing this.

    It came in handy today. I upgraded my machine to Ubuntu 7.10 on Friday and had no problems, but this morning, my partner installed Kubuntu 7.10 and had had all kinds of problems because he uses 7 different drives on two different controllers. The problems he ran into was because the new kernel changed the /dev/sd & hd device names.

    We finally got around it by unhooking all but the volume we used for the root file system, and then added the other drives into fstab via the UUID method.

    I remembered reading this a few days ago so I came back to refresh my memory on how to see each device’s UUID.

    So, thanks again!

  5. A word of caution:

    I configured my /etc/fstab to use UUID for the root partition (default with Feisty Fawn install) and the laptop ran out of power during a normal user session, with some file corruption.

    Upon reboot the file system check for the root partition was forced, and this check failed for some reason. I used the Ubuntu Live CD to fsck the root partition and there was no problem, but still on boot the system still forced me to do the same file system check and it would fail yet again, no matter how many times I tried.

    I used the Live CD to look at /etc/fstab and saw the UUID statements. I replaced the line for the root partition with the old-fashioned way (/dev/sda1) – this time the file system check passed and the boot continued ok.

    I am sure that people with less patience would have probably reinstalled or swapped back to an evil OS for this reason alone.

  6. Hi,

    I just wanted how this uuids are assigned? Is this done by linux? What would happen to the uuid if i formatted the drive/partition?

  7. Roonaldo: I have no idea how uuid calculate the id and assigns to your partition. It seems to me that if you format your partition , uuid will stay unchange, but if you RESIZE or add in a new partition, uuid will be different.

  8. What is the advantage of using UUID?

  9. Mount with device with UUID, you do not need to worry about the ordering of your HDD. I can change my HDD that contain MBR from IDE0 to IDE1, and my system will still able to boot up.

  10. There is some info on how to use LABEL/UUID in fstab and howto use uuidgen, tune2fs to put/replace labels/uuids on disks. read the howro on http://www.nslu2-linux.org/wiki/HowTo/MountDisksByLabel
    and the comments on http://liquidat.wordpress.com/2007/10/15/short-tip-get-uuid-of-hard-disks/


  11. Thankyou for this. I have 3 internal drives that had been changing and I could not work out how to fix it. I run Ubuntu 7.04, and have learned a lot from the excellent Ubuntu community and sites like this.

  12. Welcome to Ubuntu community and thanks for visiting this page.

  13. Thanks a lot!


  14. Hey, I might say, excelent tip! Thanks :)

  15. Thanks.. this was a great tip…..

  16. ok, err, i dessire to knwon what package are the resposable for write the fstab, can be possible change this by use uuid even the device naming, currently lenny used scsi device names now, every device now are handle as scsi device, whell see ..

  17. SOS! My car was boken on road. Must IJ cazll to repairs or 911?

  18. and whta do you thhink about gas problem in Ukraine?

  19. wonderful post))

  20. Where I may to find blogs n this otpic?

  21. It’s difficult to understand..

  22. Spuer! I’ll make similar post in own blog

  23. Thanks, I never remember how to find the UUID. Note that on RHEL4 (yes, I know, but our IT department ‘standardised’ on it) it seems that neither /dev/disk/by-uuid/ nor vol_id exist (it’s an ancient kernel), but fortunately /sbin/blkid does. And you have to run it as root to show some of the disks (but not others). But I got there eventually…

  24. Thanks, this fixed my problem with multiple drives and boot failure!

  25. Everything has its 2 sides: I had to install RAID1 on a running hardy-heron server. I switched over to good old /dev/sdx etc. and RAID was running in no time.

    Even more: if you have to change disks its much easier !

  26. [...] it seems much better, but I couldn't find anything. UUID's can be used for mounting (fstab): Linux by examples – fstab with uuid (search with fstab uuid and get a ton of hits) And although I never tried using UUID's and grub [...]

  27. [...] Thanks to Linux By Examples for the initial howto. [...]

  28. Thanks bro.

  29. The receiver will never know that you have talented them with swiss replica watches. In fact they will be delighted to accept these swiss replica watches since they see it as the primitive. Go out today and get by payment a pair of these swiss replica watches. Do not confine yourself to just one and let your fancy run wild while you are purchasing these swiss replica watches. You can be rest assured that these watches will serve you for many years to come and that they will never let you down. However do not overdo it. There are some fanatics in place and people have reported seeing them wearing two swiss replica watches, one on each palm and fingers. Now this is taking things too far.

  30. [...] I don't know the answer to your question, but would mounting using UUID rather than LABEL be a viable alternative? fstab with uuid [...]

  31. Hey there! I just want to give you a huge thumbs up for your great info you’ve got right here on this post.
    I’ll be returning to your website for more soon.

  32. Hi there very nice blog!! Man .. Beautiful .. Amazing ..
    I’ll bookmark your website and take the feeds also? I am glad to find a lot
    of helpful info right here in the post, we need work out more strategies on this regard, thank you for sharing.
    . . . . .

  33. Terrific post however , I was wanting to know if you could write a litte more on
    this subject? I’d be very thankful if you could elaborate a little bit more.
    Bless you!

  34. Someone essentially lend a hand to make seriously
    articles I might state. That is the very first time I frequented your web page and up to now?

    I amazed with the analysis you made to make this particular submit incredible.
    Magnificent job!

  35. I appreciate, cause I found exactly what I was taking a look for.
    You have ended my four day long hunt! God Bless you man.
    Have a great day. Bye

  36. Hi, Neat post. There is an issue with your site in internet explorer, may check this?
    IE nonetheless is the marketplace chief and a good part of other
    folks will miss your great writing because of this problem.

  37. If some one wants to be updated with hottest technologies afterward he must be visit this web site and be up to date everyday.

  38. I’m really enjoying the design and layout of your website.
    It’s a very easy on the eyes which makes it much more pleasant
    for me to come here and visit more often.
    Did you hire out a designer to create your theme?
    Fantastic work!

  39. Your gym time is time that’s just for you, and when you’re
    prepared mentally and physically, you’ll have a better workout.
    For the most effective workout, it is best not to decide what you will do at the gym
    while you are walking into the gym. Sinusitis is an inflammation of the membrane
    lining of any sinus.

  40. Most of the cures that you find over the counter or suggested
    by your doctor contain certain harmful chemicals which if applied overtime can cause serious damage to your face and health.
    If you really require to treat your Acne Vulgaris situation, then you should
    go for holistic treatments. These treatments are made of natural remedies that has been found to be very productive since years.
    Also, as these are natural, there is no space for side effects.
    The cost element too is in their side as it is cheap in comparision
    with other forms of cure. The most biggest factor is that it could give you relief more frequently compared
    to not and hence this is your right option for treating Acne Vulgaris.
    If you wish to find regarding curing Acne Vulgaris, I am mentioning a
    link, here you could be able to see elaborated inmaking on how to treat Acne Vulgaris.

    facial acne cure

  41. We really are presenting Nine dogecoins for the
    fortunate winner of a web blog operator with the selected prize promo
    code. The final results shall be out in 4-weeks time. The prize code is:

  42. These are really impressive ideas in concerning blogging.
    You have touched some good points here. Any way keep up wrinting.

  43. The other day, while I was at work, my sister stole my iphone
    and tested to see if it can survive a thirty foot drop, just
    so she can be a youtube sensation. My apple ipad is now destroyed
    and she has 83 views. I know this is entirely
    off topic but I had to share it with someone!

    Here is my homepage Mise à l’épreuve Télécharger

  44. Wine Bottles: You can paint these and use them
    as candle holders and vases. In fact, many companies that sell partition systems
    offer free planning and installation. The employer needs to help the employees feel at home so that the employees can be at their best productivity.

  45. Acne occur because of internal dis-balance in the body because of too much presence of some toxins.
    Such toxins then foil with the many glands of the body
    resulting in more than normal production of certain kinds of hormones that causes
    impurity of blood. You must have heard regarding the impurity stuff related
    to blood in many illness. Have you ever wondered what exactly is it.
    It is the more than normal presence of toxins in the blood than usual
    which lead to different type of problems in the body. Acne
    are one of these.
    Remove acne scars

  46. I am not sure where you are getting your info, but good topic.
    I needs to spend some time learning much more or understanding more.

    Thanks for fantastic information I was looking for this information for my mission.

  47. hi!,I love your writing very much! percentage we keep
    in touch extra approximately your post on AOL?
    I need an expert on this area to unravel my problem.
    May be that is you! Looking ahead to see you.

  48. It’s very effortless to find out any matter on web as compared to books,
    as I found this article at this web site.

  49. You really make it seem really easy along with your presentation but I in finding this matter
    to be actually something which I believe I’d never understand.
    It seems too complex and very large for me. I am taking a look forward in your subsequent submit, I’ll attempt to get the
    grasp of it!

  50. Very good info. Lucky me I discovered your blog by
    chance (stumbleupon). I’ve book marked it for later!

  51. Hey, I think your website might be having browser compatibility
    issues. When I look at your blog in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, great blog!

  52. I leave a response whenever I like a post on a website or if
    I have something to add to the discussion. Usually it’s caused by the sincerness communicated in
    the post I read. And after this article fstab with uuid
    ? Linux by Examples. I was excited enough to write a thought :
    -) I do have 2 questions for you if it’s okay. Is it only
    me or does it look like like a few of these responses come across as if they are left by brain
    dead individuals? :-P And, if you are writing on other online social sites, I would like to follow everything new you have
    to post. Could you make a list all of all your community
    sites like your Facebook page, twitter feed, or linkedin profile?

  53. It also has an alarm, countdown timer and is backlit.
    One word for the menu is “eclectic,” with everything from
    salads to a Fat Julian (Kickback’s version of heart attack on a plate) to sloppy joes, spaghettios, and chicken artichoke risotto orzo.
    However, this is not the case in real, yeah sometimes,
    it happens that people cheat but most of the time deals
    are very real and profitable.

    Look into my blog Best Sports Watch 2014

  54. Hi there, I enjoy reading through your article. I like to write a little comment to support

  55. Hey exceptional website! Does running a blog such as this take a massive amount work?

    I’ve virtually no expertise in computer programming but I was hoping to start my
    own blog soon. Anyways, if you have any recommendations or techniques for new blog owners please share.

    I know this is off subject but I simply wanted to ask.
    Appreciate it!

  56. With technology today, there are a lot of different possibilities in terms of education. The one who answers the
    most questions correctly gets to take home the
    trophy. Keep in mind however, to really enjoy these
    type of games, you need to understand how the games work.

    Here is my homepage … 8 ball game pool

  57. Great weblog right here! Additionally your site lots up fast!
    What web host are you the use of? Can I get your affiliate
    hyperlink for your host? I want my web site loaded up as quickly as yours lol

    My web page :: Awesome Female In Real Estate

  58. Hi it’s me, I am also visiting this site regularly,
    this site is genuinely fastidious and the visitors are truly sharing pleasant thoughts.

  59. Hello, after reading this awesome paragraph i am too glad
    to share my knowledge here with friends.

  60. I’m curious to find out what blog system you are working with?
    I’m experiencing some small security problems with my latest site and I’d like to find something more safe.

    Do you have any solutions?

  61. Can I simply just say what a comfort to discover an individual who truly knows what they’re talking about online.
    You certainly realize how to bring a problem to light and make it important.
    More and more people have to look at this and understand this side
    of your story. It’s surprising you aren’t more
    popular given that you surely possess the gift.

    My web blog :: Anesthesia Universe

  62. There is no down payment or deposit of any
    sorts and the payment invoice is sent only after the job has been inspected and
    approved by our building department and the post-job cleanup
    has been done. * When the base sheeting is coated with the aluminium and zinc alloy only, that is no further coloured coatings, it
    does look similar to the old galvanised iron, but it does not have
    the spangled effect. Roof replacement can be an expensive, time consuming job.

  63. Excellent way of describing, and fastidious article to get data regarding my
    presentation focus, which i am going to convey in institution of higher education.

  64. Woah! I’m really loving the template/theme of this blog.
    It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between usability and
    visual appeal. I must say that you’ve done a amazing job with this.

    In addition, the blog loads super quick for
    me on Chrome. Excellent Blog!

  65. Great post. I was checking constantly this blog and I’m inspired!
    Very useful info particularly the closing part :) I maintain such info much.
    I used to be seeking this particular information for a long time.
    Thank you and best of luck.

  66. I have been exploring for a bit for any high quality articles or blog
    posts on this kind of house . Exploring in Yahoo I finally stumbled upon this website.

    Studying this information So i am satisfied to show that I have
    a very good uncanny feeling I found out exactly what I needed.
    I most without a doubt will make sure to don?t omit this site
    and give it a glance on a continuing basis.

  67. After going over a few of the blog articles on your blog, I honestly like your way
    of blogging. I saved as a favorite it to my bookmark site list and will be checking back soon. Please check out my website as well
    and let me know your opinion.

  68. Hello! This is my first comment here so I just wanted to give a quick shout out and say I
    genuinely enjoy reading through your posts. Can you suggest
    any other blogs/websites/forums that deal with the same topics?

  69. I think this is one of the most significant information for me.
    And i am glad reading your article. But wanna remark on few general things, The website style is great,
    the articles is really great : D. Good job, cheers

    My blog vimeo – dean Graziosi

  70. For now the college is using an empirical approach to the i – Pad which has
    generated mixed results. 1) How many families does the
    agency have in its China Waiting Child program.
    As the popularity of adoption is growing every day, and the
    number of adoptive parents is increasing, the need
    for information on the adoption process and available adoption services has grown.

    my webpage; Adoption Network Law Center see here

  71. While hosted applications and VoIP are inseparable ass they go collusively
    in tender and it’s admirably termed as concern VoIP.
    It had been suggested that the supplier. The telecommunication services in Gujarat, Himachal Pradesh and
    Madhya Pradesh, Jammu & Kashmir, Kerala, Madhya
    telecommunications Pradesh, Jammu & Kashmir,
    Kerala, Madhya Pradesh. Mobile phones are improving by leaps and
    bounds. If yyou care to mak equity investments from $250, 000 linews by August 30, opening and
    closing of contacts in a cycle of improvement and natural obsolescence.

  72. Thank you a lot for sharing this with all of us you actually understand what you are speaking approximately!
    Bookmarked. Please also consult with my site =). We may
    have a hyperlink trade contract between us

  73. Bluzy Z Nadrukiem W?Asnym
    domain name registrations
    ulcerative colitis
    drivers ed
    canon printer
    at&t cellular
    gene juarez

  74. Undeniably believe that which you stated. Your favorite justification seemed to be on the internet the simplest thing to be aware of.
    I say to you, I certainly get annoyed while people consider
    worries that they just don’t know about. You managed to hit the nail upon the top as well
    as defined out the whole thing without having side effect , people can take a signal.
    Will probably be back to get more. Thanks

  75. hello!,I like your writing very so much! share we keep up a correspondence extra about your article on AOL?
    I need a specialist on this area to resolve my problem.
    Maybe that is you! Taking a look forward to peer you.

  76. The Scientific American magazine article refers readers to a
    study published online in January in Quality of Life Research found
    that about half of tinnitus sufferers also have mental disorders,
    confirming the findings of previous research. We know that some drugs may affect some of the cells in the hearing system,
    especially in people who happen to be particularly sensitive.

    The holistic therapy is based on scientific fact along with the study he completed.

  77. I savour, result in I discovered just what I used to
    be looking for. You’ve ended my 4 day lengthy hunt!

    God Bless you man. Have a great day. Bye

  78. Howdy very nice site!! Maan .. Beautiful .. Amazing ..

    I’ll bookmark your blog and tzke the feeds additionally?
    I am satisfied too seek out a lot of helpful info here within the post, we need develop
    mire strategies on this regard, thanks for sharing.
    . . . . .

  79. I really do take into consideration each of the concepts you could have released inside your post. There’re really convincing and definitely will absolutely perform. Nevertheless, this articles are far too swift for freshies medicare ‘solutions. May well you desire stretch them a tad through next moment? Wanted publish.

  80. Asking questions are truuly god thing iif you are not uunderstanding something completely, except this piece of writing ofers fastidious understanding yet.

    my web site released games (medium.com)

  81. Excellent blog you’ve got here.. It’s hard to find good quality writing like yours these
    days. I honestly appreciate people like you! Take care!!

    My blog: tsingy de bemaraha

  82. Your style is very unique in comparison to other
    folks I’ve read stuff from. Thank you for posting
    when you have the opportunity, Guess I’ll just bookmark this page.

  83. Baseband is a part of iOS which controls your
    connection to the carrier network. Enabling this attribute will allow you
    to immediately answer without quitting the existing
    page. Does somebody hide programs on an iPhone?

  84. It’s just uncomplicated. 1st you have to obtain software which will allow you to jailbreak
    your iPad. First, you’ve got to make guaranteed the computer you’re applying is up to day.
    Welcome to our world, the universe of advancement.

Leave a Reply