Menu

Cloning Ubuntu swap fstab issues

rick
2009-05-27
2 days ago
  • rick

    rick - 2009-05-27

    I have been using drbl-clonezilla server to clone windows with great results. I am now getting ready to start doing some Ubuntu workstations. I have a desktop system with very basic partition layout. It is sda1= /, sda2=swap, and sda3=/home. I have saved the install to the server and restored it to an identical system. I notice that the sda1 (/) and sda3 (/home) are restored, but not swap. There appears to be a swap partition on the disk but it does not appear to be active according to system monitor(0 of 0 swap in use). When I try blkid in terminal, the swap partition (/dev/sda2) is not listed. The UUID for sda1 and sda3 both are listed.

    I suspect that this has something to do with the swap partition being specified by UUID in the /etc/fstab. I know that I can reformat the swap partition and edit /etc/fstab to change the UUID. I also suspect that removing the UUID in the fstab of the master system and reverting to /dev/sda2 would be easier in the long run and probably work.

    My question is this: Is there something I am overlooking in the cloning and restoring of the image that is causing this problem?

    Thanks!

     
    • Steven Shiau

      Steven Shiau - 2009-05-30

      When Clonezilla clones, it only save the UUID and label of swap partition. Then when restoring, it will try to create it by the command /sbin/mkswap-uuid with corresponding parameter to restore the UUID or label.

      Did you see any error messages when Clonezilla formating the swap partition ?
      What are the results if you run ?
      cat /home/partimag/$YOUR_IMAGE_NAME/swappt*.info (replace $YOUR_IMAGE_NAME with your image name)

      Steven.

       
      • rick

        rick - 2009-06-03

        Thanks for the info! I will try that and let you know.

        I have found by observing the clone process that the swap partition appears to copy, but on all (recent at least) clones, I have to boot with pmagic and use gparted to format the swap. I now have the master image set without UUID on the swap in fstab. Thus, once the swap partition on the clone is formatted it is recognized on boot.

        The only other issued I am seeing for the moment is the incrementing  ethernet interfaces, but I know that that is a udev thing.

         
        • Steven Shiau

          Steven Shiau - 2009-06-04

          OK, please keep us posted.

          Steven.

           
    • rick

      rick - 2009-06-04

      Hi! I went in today and ran another test on our Clonezilla Server. I verified the partition UUID of the swap partition on the system to be cloned (Ubuntu Hardy). I then saved the image to the server (Hardy also with latest Clonezilla updated as of yesterday) and verified the UUID with the command provided above. They match.

      I then cloned the image from the server to a machine that is identical to the source machine.  When it is rebooted, I still find that the cloned machine does not have a swap partition and running blkid only shows the UUID for the other two partitions. When I see this and boot Parted Magic and look at the partitions with GParted, I find that the partition that should be swap is "unknown partition". As I stated earlier, I can format it, copy the new UUID into /etc/fstab and reboot and all is well.

      I don't know how long this has been happening, because I have not been monitoring it and we haven't  been doing many Ubuntu machines in the past. It is not a major deal to fix, but it would be interesting to know if anyone else is running into this problem as well.

       
      • Steven Shiau

        Steven Shiau - 2009-06-05

        Rick,
        When you run "/opt/drbl/sbin/dcs" to start Clonezilla to clone the image to the machine, please enter expert mode, set your client to command line prompt by choosing "-p true" in the advanced parameters. Then boot your client, and when the partition is restored, in around the end of the clonezilla action, i.e. before "grub-install" is run, you will see something like:
        *****************************************************
        Creating swap partition /dev/hda2...
        Found the swap partition /dev/hda2 info in the image dir, create it by:
        mkswap-uuid  -U 190e60ba-0331-430c-9df0-fbf9997a4d5a /dev/hda2
        Setting up swapspace version 1, size = 511963 kB
        no label, UUID=190e60ba-0331-430c-9df0-fbf9997a4d5a
        *****************************************************

        Please check if any error about this action ?
        Thanks in advance.

        Steven.

         
    • rick

      rick - 2009-06-04

      The thought occurred to me that I should do away with swap partitions on all my builds and use swap files instead. That would be one solution.

       
      • Steven Shiau

        Steven Shiau - 2009-06-05

        Rick,
        Using swap file is a workaround. For us, we'd like to fix this if this problem does exist. Here I can not reproduce the problem, so I need your help to see why mkswap-uuid failed there.

        Thanks in advance.

        Steven.

         
    • rick

      rick - 2009-06-09

      I will be running more tests. Let me know what data you need.

      I also noticed that the swap UUID is also located in /etc/intiramfs-tools/conf.d/resume. I will try to make sure it is correct there also.

       
    • rick

      rick - 2009-06-10

      OK I did another test today. The Hardy master image was checked out to make sure that swap uuid for fstab and resume were correct. I saved to the server (running Hardy Server) updated as of last week with latest DRBL stable (clonezilla version is 2.3.3-24.

      I can tell immediately that the swap was not copied correctly because the usplash crashes on bootup due to the incorect uuid in resume.

      I saved the image to a samba share using the last intrepid livecd and found the same problem when restoring.

      I then saved the image to a samba share using the latest jaunty livecd (2090603) and restored with the same and found it was successful!

      Just to see what happened, I restored an image created with the intrepid livecd using the jaunty livecd and found it failed.

      I am suspecting that it is the version of the clonezilla package as I see that mkswap-uuid is that same for all three. Is that a correct assumption?

       
      • Steven Shiau

        Steven Shiau - 2009-06-11

        "mkswap-uuid is that same for all three" -> Yes. It's the same.
        So you did not see any error messages when Clonezilla used mkswap-uuid to create the swap partition ?

        Steven.

         
    • rick

      rick - 2009-06-10

      OK I did another test today. The Hardy master image was checked out to make sure that swap uuid for fstab and resume were correct. I saved to the server (running Hardy Server) updated as of last week with latest DRBL stable (clonezilla version is 2.3.3-24.

      I can tell immediately that the swap was not copied correctly because the usplash crashes on bootup due to the incorect uuid in resume.

      I saved the image to a samba share using the last intrepid livecd and found the same problem when restoring.

      I then saved the image to a samba share using the latest jaunty livecd (2090603) and restored with the same and found it was successful!

      Just to see what happened, I restored an image created with the intrepid livecd using the jaunty livecd and found it failed.

      I am suspecting that it is the version of the clonezilla package as I see that mkswap-uuid is that same for all three. Is that a correct assumption?

       
    • rick

      rick - 2009-06-11

      No, as I stated above, I never received any error while cloning or restoring, but the swap partition was not valid except using jaunty live.

      This means we can clone one by one, but we would be like to be able to use the server and clone 6 or 8 at once. Any advice you can give is appreciated.

       
    • rick

      rick - 2009-06-19

      So do you think the problem is the version of Clonezilla is newer in Jaunty Live compared to stable server?

       
      • Steven Shiau

        Steven Shiau - 2009-06-22

        Rick,
        Maybe. Unless I can compare all the related programs that I can make sure that.

        Steven.

         
    • rick

      rick - 2009-06-22

      I will be happy to do further testing. if it will help pinpoint the problem.

       
  • Philipp Veselovsky

    Steven,
    Sorry for reopening this discussion from 2009. Has it been resolved? I am facing the same problem. I am cloning a computer with SLES11.3 Linux OS. After cloning, /dev/sda2 is missing its label "swappart" is missing. The computer boots, but complains about low swap memory.
    I'm using Clonezilla version 3.10.11-3 which came with repository of Ubuntu 16.04. Ubuntu 16.04 is running on a USB flash drive, and I have a script that captures the image of sda and sdb on one computer, and clones it into another.
    I'm using '/usr/sbin/ocs-sr -q2 -c -j2 -gm -z1p -i 4096 -p true savedisk "MASTER" sda sdb' to save image, and '/usr/sbin/ocs-sr -g auto -e1 auto -e2 -c -r -irhr -j2 -p true restoredisk "MASTER" sda sdb' to restore the image.
    I can see both uuid and label captured correctly in file swappt-sda2.info.
    Clonezilla log file during installation says "Finding swap partitions in MBR table /home/partimag/MASTER/sda-pt.sf", but there are no labels in that file.
    I appreciate any help or idea that would help me solve this.
    Thanks,
    Philipp

     
  • Steven Shiau

    Steven Shiau - 2018-01-03

    Yes, we made some imrpovements about that. The label and UUID for swap partition are saved in the file something like:
    swappt-sda5.info
    Its conent is like:
    UUID="608815fc-c140-43ea-99a4-f4f49f18583d"
    LABEL="myswap"

    Clonezilla will use these info to recreate the swap partition.

    Steven

     
  • Photon

    Photon - 2025-09-11

    Some more years later I still got the same issue: When trying to clone a Debian 13 machine with Clonezilla, the swap partition is shown as unknown partition type and its UUID does not match the entry in /etc/fstab and in the resume option in /etc/default/grub. I need to clone a master image to ~20 machines and it would be a PITA to chroot each of them to reformat the swap partition and correct the UUID. Any thoughts on how to fix the issue and streamline the process?

     
  • Steven Shiau

    Steven Shiau - 2025-09-11

    We never have this issue here.
    Could you please share the log file /var/log/clonezilla.log after you encounter this issue?
    It will provide more info so that we can try to fix this issue for you.

     
    • Photon

      Photon - 6 days ago

      Hi Steven, sorry for the very long delay! Here are the requested logs.

       
  • Steven Shiau

    Steven Shiau - 2 days ago

    Could you please use the latest Clonezilla live to run this? i.e., 3.3.0-33 or 20251017-questing?
    Check if this issue is reproducible or not.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.