in which cases it will be problematic to configure UUID in fstab

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












We are thinking about to change all Linux fstab configuration to work with UUID instead the current configuration



Some of the disks are with non RAID and some of the disks are with RAID10



I searched in google and find complain about using UUID for RAID1 :



" Unfortunately you MUST NOT use UUID in /etc/fstab if you use software RAID1. Why? Because the RAID volume itself and the first element of the mirror will appear to have the same filesystem UUID. If the mirror breaks or for any other reason the md device isn't started at boot, the system will mount any random underlying disk instead, clobbering your mirror. Then you'll need a full resync. Bad juju."



So I just want to know if we can use UUID for RAID10 ?



and in which cases ( RAID configuration ) not to use UUID?



second - in few lines what are the benefit to use UUID ?







share|improve this question
















  • 1




    I wonder where that quote is from, and how old it is. Actually, now I also wonder if you cross-posted this to serverfault too, since there's quite an identical question there from just two hours earlier.
    – ilkkachu
    Dec 6 '17 at 17:44














up vote
3
down vote

favorite












We are thinking about to change all Linux fstab configuration to work with UUID instead the current configuration



Some of the disks are with non RAID and some of the disks are with RAID10



I searched in google and find complain about using UUID for RAID1 :



" Unfortunately you MUST NOT use UUID in /etc/fstab if you use software RAID1. Why? Because the RAID volume itself and the first element of the mirror will appear to have the same filesystem UUID. If the mirror breaks or for any other reason the md device isn't started at boot, the system will mount any random underlying disk instead, clobbering your mirror. Then you'll need a full resync. Bad juju."



So I just want to know if we can use UUID for RAID10 ?



and in which cases ( RAID configuration ) not to use UUID?



second - in few lines what are the benefit to use UUID ?







share|improve this question
















  • 1




    I wonder where that quote is from, and how old it is. Actually, now I also wonder if you cross-posted this to serverfault too, since there's quite an identical question there from just two hours earlier.
    – ilkkachu
    Dec 6 '17 at 17:44












up vote
3
down vote

favorite









up vote
3
down vote

favorite











We are thinking about to change all Linux fstab configuration to work with UUID instead the current configuration



Some of the disks are with non RAID and some of the disks are with RAID10



I searched in google and find complain about using UUID for RAID1 :



" Unfortunately you MUST NOT use UUID in /etc/fstab if you use software RAID1. Why? Because the RAID volume itself and the first element of the mirror will appear to have the same filesystem UUID. If the mirror breaks or for any other reason the md device isn't started at boot, the system will mount any random underlying disk instead, clobbering your mirror. Then you'll need a full resync. Bad juju."



So I just want to know if we can use UUID for RAID10 ?



and in which cases ( RAID configuration ) not to use UUID?



second - in few lines what are the benefit to use UUID ?







share|improve this question












We are thinking about to change all Linux fstab configuration to work with UUID instead the current configuration



Some of the disks are with non RAID and some of the disks are with RAID10



I searched in google and find complain about using UUID for RAID1 :



" Unfortunately you MUST NOT use UUID in /etc/fstab if you use software RAID1. Why? Because the RAID volume itself and the first element of the mirror will appear to have the same filesystem UUID. If the mirror breaks or for any other reason the md device isn't started at boot, the system will mount any random underlying disk instead, clobbering your mirror. Then you'll need a full resync. Bad juju."



So I just want to know if we can use UUID for RAID10 ?



and in which cases ( RAID configuration ) not to use UUID?



second - in few lines what are the benefit to use UUID ?









share|improve this question











share|improve this question




share|improve this question










asked Dec 6 '17 at 12:40









yael

2,0231145




2,0231145







  • 1




    I wonder where that quote is from, and how old it is. Actually, now I also wonder if you cross-posted this to serverfault too, since there's quite an identical question there from just two hours earlier.
    – ilkkachu
    Dec 6 '17 at 17:44












  • 1




    I wonder where that quote is from, and how old it is. Actually, now I also wonder if you cross-posted this to serverfault too, since there's quite an identical question there from just two hours earlier.
    – ilkkachu
    Dec 6 '17 at 17:44







1




1




I wonder where that quote is from, and how old it is. Actually, now I also wonder if you cross-posted this to serverfault too, since there's quite an identical question there from just two hours earlier.
– ilkkachu
Dec 6 '17 at 17:44




I wonder where that quote is from, and how old it is. Actually, now I also wonder if you cross-posted this to serverfault too, since there's quite an identical question there from just two hours earlier.
– ilkkachu
Dec 6 '17 at 17:44










3 Answers
3






active

oldest

votes

















up vote
1
down vote



accepted










Answer to your second question: an UUID allows you to uniquely identify a device.



Devices are assigned as /dev/sda, /dev/sdb, etc. depending on the order the system discovers them. While the drive the system boots on is always the first, for the others their name assignment depends on the order of discovery and might change after a reboot.



Also, imagine you have drives /dev/sdc and /dev/sdd, and you physically remove the first drive; after reboot, what was known as /dev/sdd is now called /dev/sdc.



This makes identification of devices ambiguous. UUIDs avoid all ambiguity; as the UUID is stored in the superblock (for a block device), it pertains to the device itself.






share|improve this answer






















  • about RAID10 , can we be sure to use UUID for that?
    – yael
    Dec 6 '17 at 12:54

















up vote
2
down vote













Adding to @dr01 answer: about the RAID questions, you can also use UUID in RAID settings.



If using mdadm, the UUID will be stored in the local filesystem, if using hardware RAID, it will be presented as a virtual physical disk, which again will have a UUID.






share|improve this answer



























    up vote
    1
    down vote













    I think this is only an issue in cases where the data on the RAID device is also identically present in the same position on the underlying devices (or at least some of them). In practice that means the RAID formats where the RAID superblock (metadata) is at the end of the partition.



    Since the UUID is part of the filesystem(*), the system must find a supported filesystem on the device first. Filesystems are identified by reading some set locations on the device, usually at the beginning, and looking for identifying signatures. If the same data is visible in the same position in a raw disk (like /dev/sda) and a raid device (/dev/md0) the same UUID can be found in two devices. Or more, if there are copies of the data on other devices, i.e. the other side of the mirror.
    (* The UUIDs of GPT partitions are a different matter)



    The Linux software RAID system knows of two main superblock formats, the original (v. 0.90) format puts the superblock at the end, and the current (v. 1) has three subformats for different positions of the superblock. Since the superblock formats 1.1 and 1.2 put the superblock in the beginning, they should be safe to use. 0.9 and 1.0 put the superblock at the end of the device, so they are the ones you can get into issues. /proc/mdstat should show you the superblock format for each device.



    The RAID wiki page also contains a warning about placing the superblock at the end of the device.



    With RAID 0 or RAID 10 it's hard to read the filesystem through the underlying disks, since the data is striped. But the UUID's might still be detectable, so it's probably best to use the 1.2 format RAID superblock in
    any case.



    For ext2/3/4 filesystems, tune2fs -l $device might be able to show you the filesystem UUID if it's possible to find (blkid might find the RAID UUID instead.)




    Note that I'm writing this based on my understanding of the documentation, I didn't explicitly test with a RAID superblock at the end.






    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409196%2fin-which-cases-it-will-be-problematic-to-configure-uuid-in-fstab%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote



      accepted










      Answer to your second question: an UUID allows you to uniquely identify a device.



      Devices are assigned as /dev/sda, /dev/sdb, etc. depending on the order the system discovers them. While the drive the system boots on is always the first, for the others their name assignment depends on the order of discovery and might change after a reboot.



      Also, imagine you have drives /dev/sdc and /dev/sdd, and you physically remove the first drive; after reboot, what was known as /dev/sdd is now called /dev/sdc.



      This makes identification of devices ambiguous. UUIDs avoid all ambiguity; as the UUID is stored in the superblock (for a block device), it pertains to the device itself.






      share|improve this answer






















      • about RAID10 , can we be sure to use UUID for that?
        – yael
        Dec 6 '17 at 12:54














      up vote
      1
      down vote



      accepted










      Answer to your second question: an UUID allows you to uniquely identify a device.



      Devices are assigned as /dev/sda, /dev/sdb, etc. depending on the order the system discovers them. While the drive the system boots on is always the first, for the others their name assignment depends on the order of discovery and might change after a reboot.



      Also, imagine you have drives /dev/sdc and /dev/sdd, and you physically remove the first drive; after reboot, what was known as /dev/sdd is now called /dev/sdc.



      This makes identification of devices ambiguous. UUIDs avoid all ambiguity; as the UUID is stored in the superblock (for a block device), it pertains to the device itself.






      share|improve this answer






















      • about RAID10 , can we be sure to use UUID for that?
        – yael
        Dec 6 '17 at 12:54












      up vote
      1
      down vote



      accepted







      up vote
      1
      down vote



      accepted






      Answer to your second question: an UUID allows you to uniquely identify a device.



      Devices are assigned as /dev/sda, /dev/sdb, etc. depending on the order the system discovers them. While the drive the system boots on is always the first, for the others their name assignment depends on the order of discovery and might change after a reboot.



      Also, imagine you have drives /dev/sdc and /dev/sdd, and you physically remove the first drive; after reboot, what was known as /dev/sdd is now called /dev/sdc.



      This makes identification of devices ambiguous. UUIDs avoid all ambiguity; as the UUID is stored in the superblock (for a block device), it pertains to the device itself.






      share|improve this answer














      Answer to your second question: an UUID allows you to uniquely identify a device.



      Devices are assigned as /dev/sda, /dev/sdb, etc. depending on the order the system discovers them. While the drive the system boots on is always the first, for the others their name assignment depends on the order of discovery and might change after a reboot.



      Also, imagine you have drives /dev/sdc and /dev/sdd, and you physically remove the first drive; after reboot, what was known as /dev/sdd is now called /dev/sdc.



      This makes identification of devices ambiguous. UUIDs avoid all ambiguity; as the UUID is stored in the superblock (for a block device), it pertains to the device itself.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Dec 6 '17 at 12:55

























      answered Dec 6 '17 at 12:51









      dr01

      15.3k114769




      15.3k114769











      • about RAID10 , can we be sure to use UUID for that?
        – yael
        Dec 6 '17 at 12:54
















      • about RAID10 , can we be sure to use UUID for that?
        – yael
        Dec 6 '17 at 12:54















      about RAID10 , can we be sure to use UUID for that?
      – yael
      Dec 6 '17 at 12:54




      about RAID10 , can we be sure to use UUID for that?
      – yael
      Dec 6 '17 at 12:54












      up vote
      2
      down vote













      Adding to @dr01 answer: about the RAID questions, you can also use UUID in RAID settings.



      If using mdadm, the UUID will be stored in the local filesystem, if using hardware RAID, it will be presented as a virtual physical disk, which again will have a UUID.






      share|improve this answer
























        up vote
        2
        down vote













        Adding to @dr01 answer: about the RAID questions, you can also use UUID in RAID settings.



        If using mdadm, the UUID will be stored in the local filesystem, if using hardware RAID, it will be presented as a virtual physical disk, which again will have a UUID.






        share|improve this answer






















          up vote
          2
          down vote










          up vote
          2
          down vote









          Adding to @dr01 answer: about the RAID questions, you can also use UUID in RAID settings.



          If using mdadm, the UUID will be stored in the local filesystem, if using hardware RAID, it will be presented as a virtual physical disk, which again will have a UUID.






          share|improve this answer












          Adding to @dr01 answer: about the RAID questions, you can also use UUID in RAID settings.



          If using mdadm, the UUID will be stored in the local filesystem, if using hardware RAID, it will be presented as a virtual physical disk, which again will have a UUID.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 6 '17 at 12:55









          Rui F Ribeiro

          35.6k1271114




          35.6k1271114




















              up vote
              1
              down vote













              I think this is only an issue in cases where the data on the RAID device is also identically present in the same position on the underlying devices (or at least some of them). In practice that means the RAID formats where the RAID superblock (metadata) is at the end of the partition.



              Since the UUID is part of the filesystem(*), the system must find a supported filesystem on the device first. Filesystems are identified by reading some set locations on the device, usually at the beginning, and looking for identifying signatures. If the same data is visible in the same position in a raw disk (like /dev/sda) and a raid device (/dev/md0) the same UUID can be found in two devices. Or more, if there are copies of the data on other devices, i.e. the other side of the mirror.
              (* The UUIDs of GPT partitions are a different matter)



              The Linux software RAID system knows of two main superblock formats, the original (v. 0.90) format puts the superblock at the end, and the current (v. 1) has three subformats for different positions of the superblock. Since the superblock formats 1.1 and 1.2 put the superblock in the beginning, they should be safe to use. 0.9 and 1.0 put the superblock at the end of the device, so they are the ones you can get into issues. /proc/mdstat should show you the superblock format for each device.



              The RAID wiki page also contains a warning about placing the superblock at the end of the device.



              With RAID 0 or RAID 10 it's hard to read the filesystem through the underlying disks, since the data is striped. But the UUID's might still be detectable, so it's probably best to use the 1.2 format RAID superblock in
              any case.



              For ext2/3/4 filesystems, tune2fs -l $device might be able to show you the filesystem UUID if it's possible to find (blkid might find the RAID UUID instead.)




              Note that I'm writing this based on my understanding of the documentation, I didn't explicitly test with a RAID superblock at the end.






              share|improve this answer
























                up vote
                1
                down vote













                I think this is only an issue in cases where the data on the RAID device is also identically present in the same position on the underlying devices (or at least some of them). In practice that means the RAID formats where the RAID superblock (metadata) is at the end of the partition.



                Since the UUID is part of the filesystem(*), the system must find a supported filesystem on the device first. Filesystems are identified by reading some set locations on the device, usually at the beginning, and looking for identifying signatures. If the same data is visible in the same position in a raw disk (like /dev/sda) and a raid device (/dev/md0) the same UUID can be found in two devices. Or more, if there are copies of the data on other devices, i.e. the other side of the mirror.
                (* The UUIDs of GPT partitions are a different matter)



                The Linux software RAID system knows of two main superblock formats, the original (v. 0.90) format puts the superblock at the end, and the current (v. 1) has three subformats for different positions of the superblock. Since the superblock formats 1.1 and 1.2 put the superblock in the beginning, they should be safe to use. 0.9 and 1.0 put the superblock at the end of the device, so they are the ones you can get into issues. /proc/mdstat should show you the superblock format for each device.



                The RAID wiki page also contains a warning about placing the superblock at the end of the device.



                With RAID 0 or RAID 10 it's hard to read the filesystem through the underlying disks, since the data is striped. But the UUID's might still be detectable, so it's probably best to use the 1.2 format RAID superblock in
                any case.



                For ext2/3/4 filesystems, tune2fs -l $device might be able to show you the filesystem UUID if it's possible to find (blkid might find the RAID UUID instead.)




                Note that I'm writing this based on my understanding of the documentation, I didn't explicitly test with a RAID superblock at the end.






                share|improve this answer






















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  I think this is only an issue in cases where the data on the RAID device is also identically present in the same position on the underlying devices (or at least some of them). In practice that means the RAID formats where the RAID superblock (metadata) is at the end of the partition.



                  Since the UUID is part of the filesystem(*), the system must find a supported filesystem on the device first. Filesystems are identified by reading some set locations on the device, usually at the beginning, and looking for identifying signatures. If the same data is visible in the same position in a raw disk (like /dev/sda) and a raid device (/dev/md0) the same UUID can be found in two devices. Or more, if there are copies of the data on other devices, i.e. the other side of the mirror.
                  (* The UUIDs of GPT partitions are a different matter)



                  The Linux software RAID system knows of two main superblock formats, the original (v. 0.90) format puts the superblock at the end, and the current (v. 1) has three subformats for different positions of the superblock. Since the superblock formats 1.1 and 1.2 put the superblock in the beginning, they should be safe to use. 0.9 and 1.0 put the superblock at the end of the device, so they are the ones you can get into issues. /proc/mdstat should show you the superblock format for each device.



                  The RAID wiki page also contains a warning about placing the superblock at the end of the device.



                  With RAID 0 or RAID 10 it's hard to read the filesystem through the underlying disks, since the data is striped. But the UUID's might still be detectable, so it's probably best to use the 1.2 format RAID superblock in
                  any case.



                  For ext2/3/4 filesystems, tune2fs -l $device might be able to show you the filesystem UUID if it's possible to find (blkid might find the RAID UUID instead.)




                  Note that I'm writing this based on my understanding of the documentation, I didn't explicitly test with a RAID superblock at the end.






                  share|improve this answer












                  I think this is only an issue in cases where the data on the RAID device is also identically present in the same position on the underlying devices (or at least some of them). In practice that means the RAID formats where the RAID superblock (metadata) is at the end of the partition.



                  Since the UUID is part of the filesystem(*), the system must find a supported filesystem on the device first. Filesystems are identified by reading some set locations on the device, usually at the beginning, and looking for identifying signatures. If the same data is visible in the same position in a raw disk (like /dev/sda) and a raid device (/dev/md0) the same UUID can be found in two devices. Or more, if there are copies of the data on other devices, i.e. the other side of the mirror.
                  (* The UUIDs of GPT partitions are a different matter)



                  The Linux software RAID system knows of two main superblock formats, the original (v. 0.90) format puts the superblock at the end, and the current (v. 1) has three subformats for different positions of the superblock. Since the superblock formats 1.1 and 1.2 put the superblock in the beginning, they should be safe to use. 0.9 and 1.0 put the superblock at the end of the device, so they are the ones you can get into issues. /proc/mdstat should show you the superblock format for each device.



                  The RAID wiki page also contains a warning about placing the superblock at the end of the device.



                  With RAID 0 or RAID 10 it's hard to read the filesystem through the underlying disks, since the data is striped. But the UUID's might still be detectable, so it's probably best to use the 1.2 format RAID superblock in
                  any case.



                  For ext2/3/4 filesystems, tune2fs -l $device might be able to show you the filesystem UUID if it's possible to find (blkid might find the RAID UUID instead.)




                  Note that I'm writing this based on my understanding of the documentation, I didn't explicitly test with a RAID superblock at the end.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 6 '17 at 18:10









                  ilkkachu

                  50.1k676138




                  50.1k676138



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409196%2fin-which-cases-it-will-be-problematic-to-configure-uuid-in-fstab%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?