• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Imaging Linux systems, UUID for swap not matching on deployed systems. Eh?

    Scheduled Pinned Locked Moved
    Linux Problems
    5
    31
    18.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ianabc Testers
      last edited by

      Hi Jason, the fog script fog.download does an “mkswap” on the partition during the restore. I think that will change the UUID. The alternative would be to just dd the entire swap space which is probably what Clonezilla is doing (though I’m guessing :)).

      Reading what you are doing (congratulations by the way - a very laudable project!) there are a couple of ways you could solve this. They all come in at the time you are expanding the ext4 filesystem. At the same time you would update either the fstab or the UUID in the swap partition. After the next reboot (or after a swapon/swapoff) your swap partition would show up.

      To edit the fstab I might do something like
      [CODE]
      #!/bin/sh

      OLDUID=grep swap /etc/fstab |cut -d' ' -f1
      NEWUID=blkid | grep swap | cut -d' ' -f2

      sed “s/$OLDUID/$NEWUID/” /etc/fstab
      [/CODE]
      before I expand the ext4fs.

      If you wanted to modify the swap UUID instead, then something like
      [CODE]
      #!/bin/sh

      TARGETUID=grep swap /etc/fstab |cut -d' ' -f1 | cut -d'=' -f2
      DEVICE=blkid | grep swap | cut -d':' -f1

      swaplabel -U “$TARGETUID” $DEVICE
      swapon -a
      [/CODE]

      A third alternative is to use labels rather than UUIDs or device names.

      K 1 Reply Last reply Reply Quote 0
      • H
        Hongyun
        last edited by

        I’m having the same problem with Mageia 4 system. Attached image is what’s show up after deployed a computer. It only complaints about the swap partition UUID.

        And before I upload the image, I’ve already changed the fstab file to use either the disk name /dev/sda5, or the label of the swap partition LABEL=SWAP, in both cases, I get the same result.

        Any idea how to fix this?

        Thanks,
        Hongyun

        [url=“/_imported_xf_attachments/1/1210_dracut_error.JPG?:”]dracut_error.JPG[/url]

        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          [quote=“Hongyun, post: 34056, member: 1117”]I’m having the same problem with Mageia 4 system. Attached image is what’s show up after deployed a computer. It only complaints about the swap partition UUID.

          And before I upload the image, I’ve already changed the fstab file to use either the disk name /dev/sda5, or the label of the swap partition LABEL=SWAP, in both cases, I get the same result.

          Any idea how to fix this?

          Thanks,
          Hongyun[/quote]

          What version of FOG are you running?

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • H
            Hongyun
            last edited by

            The newest version 1.1.2

            1 Reply Last reply Reply Quote 0
            • Tom ElliottT
              Tom Elliott
              last edited by

              Chances are that’s the majority of the problem. I don’t think it did the correct things for the UUID.

              Can you upgrade to 1.2.0 and reupload the original image and test again?

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 0
              • H
                Hongyun
                last edited by

                I just upgrade the FOG server, you have a 1.2.0 now? That was fast, I will try the new version. Thanks!

                1 Reply Last reply Reply Quote 0
                • H
                  Hongyun
                  last edited by

                  I found each time after I upgrade FOG, the /etc/exports file got overwritten, I have to re-enter all my storage nodes again to make it work. Is it possible you can keep that file in your next version? Just some thoughts 🙂

                  1 Reply Last reply Reply Quote 0
                  • H
                    Hongyun
                    last edited by

                    Hi Tom,
                    I tried the new version, result is the same 😞 any other suggestions?

                    Thanks,
                    Hongyun

                    1 Reply Last reply Reply Quote 0
                    • Tom ElliottT
                      Tom Elliott
                      last edited by

                      Did you reupload the image or just try redeploying?

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 0
                      • H
                        Hongyun
                        last edited by

                        Yes, I reuploaded the image after the upgrade yesterday, and redeployed the computer today.

                        1 Reply Last reply Reply Quote 0
                        • H
                          Hongyun
                          last edited by

                          I think it has something to do with the OS. I tried reupload a working image and then download it again, it still works. But this Mageia 4.1 OS doesn’t work properly. I will try to reinstall it with ext3 partition to see if it works.

                          1 Reply Last reply Reply Quote 0
                          • I
                            ianabc Testers
                            last edited by

                            [quote=“Hongyun, post: 34129, member: 1117”]I think it has something to do with the OS. I tried reupload a working image and then download it again, it still works. But this Mageia 4.1 OS doesn’t work properly. I will try to reinstall it with ext3 partition to see if it works.[/quote]

                            UUIDs work for ext3 and ext4 filesystems because the UUID is part of the filesystem itself, it is written into the superblock. Since Fog 1.2.0 fog also seems to allow UUIDs in /etc/fstab for swap partitions. For other filesystems, I’m not sure, I haven’t noticed any problems with xfs, but I haven’t looked too close. Incidentally, there are some other reasons to use ext4 - fog 1.2.0 can resize ext4 filesystems automatically!

                            1 Reply Last reply Reply Quote 0
                            • H
                              Hongyun
                              last edited by

                              [quote=“ianabc, post: 34153, member: 24548”]UUIDs work for ext3 and ext4 filesystems because the UUID is part of the filesystem itself, it is written into the superblock. Since Fog 1.2.0 fog also seems to allow UUIDs in /etc/fstab for swap partitions. For other filesystems, I’m not sure, I haven’t noticed any problems with xfs, but I haven’t looked too close. Incidentally, there are some other reasons to use ext4 - fog 1.2.0 can resize ext4 filesystems automatically![/quote]
                              But I think the problem now is that after downloading the FOG image, the swap partition’s UUID got changed, even when I download the image to the same computer where I uploaded the image from. Our instructor prefer the Mageia 4.1, I’m still trying to make this work with FOG, a month left before the term starts, feeling the pressure now:(

                              1 Reply Last reply Reply Quote 0
                              • I
                                ianabc Testers
                                last edited by

                                From the image you showed above, are you sure that swap is the problem? what filesystems are your other partitions on? swap problems shouldn’t stop a system from booting in general - as I might have said above, it’s just swap!

                                1 Reply Last reply Reply Quote 0
                                • I
                                  ianabc Testers
                                  last edited by

                                  Actually it looks like mageia (and some fedora) might have an issue with swap UUIDs. Somebody thought that putting UUIDs into initramfs was a good idea. There are some workarounds, but I don’t have any machines to work with to try them out.

                                  [LIST]
                                  [][url]https://forums.mageia.org/en/viewtopic.php?f=7&t=7093[/url]
                                  [
                                  ][url]http://forums.fedoraforum.org/showthread.php?t=292088[/url]
                                  [/LIST]
                                  Additionally, when an instructor - or anyone for that matter - asks for a specific distribution, it is a good idea to ask them what they are intending to do with it. Unless they are working with the package manager(s) day to day it generally doesn’t matter. Usually they have conflated a specific set of applications and versions with an distribution.

                                  1 Reply Last reply Reply Quote 0
                                  • I
                                    ianabc Testers
                                    last edited by

                                    Could you take a look in /images/NAMEOFYOURIMAGE and see if you can find a file similar to “d1.original.swapuuids”. Here is one of mine
                                    [CODE]
                                    $ cat /images/RHL7x64PIMS50GBResizeable/d1.original.swapuuids
                                    /dev/sda5 7f6a8920-bab3-444d-8e3f-acca4c76e3cd
                                    [/CODE]
                                    When I deploy that image to a machine the UUID of the swap partition matches
                                    [CODE]
                                    $ blkid /dev/sda5 UUID=“7f6a8920-bab3-444d-8e3f-acca4c76e3cd”
                                    [/CODE]
                                    Obviously, change /dev/sda5 to wherever your swap partition is.

                                    1 Reply Last reply Reply Quote 0
                                    • H
                                      Hongyun
                                      last edited by

                                      [root@foggy henn205mageia4]# ls -la
                                      total 1659936
                                      drwxrwxrwx. 2 root root 4096 Jul 25 10:29 .
                                      drwxrwxrwx. 39 fog fog 4096 Jul 25 11:56 …
                                      -rwxrwxrwx. 1 root root 0 Jul 25 10:16 d1.has_grub
                                      -rwxrwxrwx. 1 root root 1048576 Jul 25 10:16 d1.mbr
                                      -rwxrwxrwx. 1 root root 1698702304 Jul 25 10:29 d1p1.img
                                      -rwxrwxrwx. 1 root root 1131 Jul 25 10:29 d1p2.img
                                      -rwxrwxrwx. 1 root root 310 Jul 25 10:16 d1.partitions

                                      That’s everything I got on the server image folder.

                                      1 Reply Last reply Reply Quote 0
                                      • H
                                        Hongyun
                                        last edited by

                                        [root@foggy henn205mageia4]# cat d1.partitions

                                        partition table of /dev/sda

                                        unit: sectors

                                        /dev/sda1 : start= 2048, size=960572497, Id=83, bootable
                                        /dev/sda2 : start=960577506, size= 16190559, Id= 5
                                        /dev/sda3 : start= 0, size= 0, Id= 0
                                        /dev/sda4 : start= 0, size= 0, Id= 0
                                        /dev/sda5 : start=960577536, size= 16190529, Id=82

                                        1 Reply Last reply Reply Quote 0
                                        • I
                                          ianabc Testers
                                          last edited by

                                          hmm…Did you create that image with an older version of fog? On fog 1.2.0 uploading a linux image gives me the following
                                          [CODE]
                                          drwxrwxrwx. 2 root root 4096 Jul 22 15:03 .
                                          drwxrwxrwx. 56 fog root 4096 Jul 22 15:03 …
                                          -rwxrwxrwx. 1 root root 4 Jul 22 14:48 d1.fixed_size_partitions
                                          -rwxrwxrwx. 1 root root 0 Jul 22 14:49 d1.has_grub
                                          -rwxrwxrwx. 1 root root 1048576 Jul 22 14:49 d1.mbr
                                          -rwxrwxrwx. 1 root root 310 Jul 22 14:49 d1.minimum.partitions
                                          -rwxrwxrwx. 1 root root 80 Jul 22 14:49 d1.original.fstypes
                                          -rwxrwxrwx. 1 root root 310 Jul 22 14:48 d1.original.partitions
                                          -rwxrwxrwx. 1 root root 47 Jul 22 15:03 d1.original.swapuuids
                                          -rwxrwxrwx. 1 root root 84480518 Jul 22 14:49 d1p1.img
                                          -rwxrwxrwx. 1 root root 1944498680 Jul 22 14:53 d1p2.img
                                          -rwxrwxrwx. 1 root root 6416223022 Jul 22 15:03 d1p3.img

                                          -rwxrwxrwx. 1 root root 125 Jul 22 15:03 d1p4.img
                                          [/CODE]
                                          Did you try [B]uploading[/B] the image with 1.2.0 and then deploying it again. N.B. This is for a “Resizeable” image, it looks like the code for “Multiple partition” images might need to be updated to match.

                                          1 Reply Last reply Reply Quote 0
                                          • H
                                            Hongyun
                                            last edited by

                                            Yes, I upload the image with 1.2.0, but the image type is Multiple Partition Image - Single Disk (Not Resizable).

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            140

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project