Menu

restored nvme from clonezilla made ext4 partition a swap partition? (can't boot)

Help
Danathar
2025-01-22
2025-01-27
  • Danathar

    Danathar - 2025-01-22

    I created a clonezilla image and saved it to an external drive. Then booted into clonezilla live (tried both Debian and Ubuntu) and restored from that image to a new nvme drive I have. It would not boot, so I booted into live linux distro (MX) and listed the partition table. My ext4 partition has a type of SWAP. I checked the clonezilla image directory and looked at the files, and my main partition is listed correctly. Why would it restore my main partition as a swap partition? I was restoring by disk and not by partition.

    The system is bog standard Debian 12.

    What is going on here?!!! I'm kinda stuck in the water.

    Any help appreciated!

    demo@mx1:~
    $ sudo fdisk /dev/nvme0n1 
    [sudo] password for demo:     
    
    Welcome to fdisk (util-linux 2.38.1).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    
    Command (m for help): p
    Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
    Disk model: WD Blue SN580 1TB                       
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x9d1b6cf4
    
    Device         Boot      Start        End    Sectors   Size Id Type
    /dev/nvme0n1p1 *          2048 1906640895 1906638848 909.2G 82 Linux swap / Solaris
    /dev/nvme0n1p2      1906642942 1953523711   46880770  22.4G  5 Extended
    /dev/nvme0n1p5      1906642944 1953523711   46880768  22.4G 82 Linux swap / Solaris
    
    Command (m for help): 
    

    Here is a the clonzilla log of when I created the image. everything looks fine to me

    $ cat clonezilla-img 
    This image was saved by Clonezilla at 2025-01-19 23:38:44 UTC.
    Saved by clonezilla-live-3.2.0-5-amd64.
    The log during saving:
    ----------------------------------------------------------
    Starting /usr/sbin/ocs-sr at 2025-01-19 22:02:52 UTC...
    *****************************************************.
    Clonezilla image dir: /home/partimag
    The selected devices: sdd
    PS. Next time you can run this command directly:
    /usr/sbin/ocs-sr -q2 -c -j2 -z9p -i 0 -sfsck -senc -p true savedisk 2025-01-19-22-img sdd
    *****************************************************.
    The selected devices: sdd
    Searching for data/swap/extended partition(s)...
    The data partition to be saved: sdd1
    The swap partition to be saved: sdd5
    The extended partition to be saved: sdd2
    The selected devices: sdd1
    The following step is to save the hard disk/partition(s) on this machine as an image:
    *****************************************************.
    Machine: All Series
    sdd (1000GB_WDC_WDS100T2B0B-_pci-0000_00_1f_2-ata-5_0_174228800155)
    sdd1 (909.2G_ext4(In_WDC_WDS100T2B0B-)_pci-0000_00_1f_2-ata-5_0_174228800155)
    *****************************************************.
    -> "/home/partimag/2025-01-19-22-img".
    Starting saving /dev/sdd1 as /home/partimag/2025-01-19-22-img/sdd1.XXX...
    /dev/sdd1 filesystem: ext4.
    *****************************************************.
    *****************************************************.
    Use partclone with zstd to save the image.
    Image file will not be split.
    *****************************************************.
    If this action fails or hangs, check:
    * Is the disk full ?
    *****************************************************.
    Running: partclone.ext4 -z 10485760 -N  -L /var/log/partclone.log -c -s /dev/sdd1 --output - | zstd -c -T0 -3 > /home/partimag/2025-01-19-22-img/sdd1.ext4-ptcl-img.zst 2> /tmp/img_out_err.BHnJlD
    Opening User Interface mode.
    Partclone v0.3.32 http://partclone.org
    Starting to clone device (/dev/sdd1) to image (-)
    Reading Super Block
    memory needed: 50762756 bytes
    bitmap 29791232 bytes, blocks 2*10485760 bytes, checksum 4 bytes
    Calculating bitmap... Please wait... 
    Total Time: 00:00:02, Ave. Rate:   0.00byte/min, 100.00% completed!
    done!
    File system:  EXTFS
    Device size:  976.2 GB = 238329856 Blocks
    Space in use: 720.6 GB = 175928137 Blocks
    Free Space:   255.6 GB = 62401719 Blocks
    Block size:   4096 Byte
    Total block 238329856
    Total Time: 01:33:28, Ave. Rate:   7.71GB/min, 100.00% completed!
    Syncing... OK!
    Partclone successfully cloned the device (/dev/sdd1) to the image (-)
    >>> Time elapsed: 5619.36 secs (~ 93.656 mins)
    *****************************************************.
    Finished saving /dev/sdd1 as /home/partimag/2025-01-19-22-img/sdd1.ext4-ptcl-img.zst
    *****************************************************.
    Saving block devices info in /home/partimag/2025-01-19-22-img/blkdev.list...
    Saving block devices attributes in /home/partimag/2025-01-19-22-img/blkid.list...
    Checking the integrity of partition table in the disk /dev/sdd... 
    Reading the partition table for /dev/sdd...RETVAL=0
    *****************************************************.
    The first partition of disk /dev/sdd starts at 2048.
    Saving the hidden data between MBR (1st sector, i.e. 512 bytes) and 1st partition, which might be useful for some recovery tool, by:
    dd if=/dev/sdd of=/home/partimag/2025-01-19-22-img/sdd-hidden-data-after-mbr skip=1 bs=512 count=2047
    2047+0 records in
    2047+0 records out
    1048064 bytes (1.0 MB, 1.0 MiB) copied, 0.00473082 s, 222 MB/s
    *****************************************************.
    Saving the MBR data for sdd...
    1+0 records in
    1+0 records out
    512 bytes copied, 0.000253853 s, 2.0 MB/s
    End of saveparts job for image /home/partimag/2025-01-19-22-img.
    *****************************************************.
    Saving swap partition sdd5 info in /home/partimag/2025-01-19-22-img/swappt-sdd5.info if it exists...
    *****************************************************.
    Saving extended partition sdd2 info in /home/partimag/2025-01-19-22-img/sdd2-ebr if it exists...
    1+0 records in
    1+0 records out
    512 bytes copied, 0.00471025 s, 109 kB/s
    End of savedisk job for image 2025-01-19-22-img.
    Checking if udevd rules have to be restored...
    This program is not started by Clonezilla server, so skip notifying it the job is done.
    Finished!
    This program is not started by Clonezilla server, so skip notifying it the job is done.
    Finished!
    ### End of log ###
    ### Image created time: 2025-0119-2338
    
     

    Last edit: Danathar 2025-01-22
  • Steven Shiau

    Steven Shiau - 2025-01-27

    "Device Boot Start End Sectors Size Id Type
    /dev/nvme0n1p1 * 2048 1906640895 1906638848 909.2G 82 Linux swap / Solaris
    /dev/nvme0n1p2 1906642942 1953523711 46880770 22.4G 5 Extended
    /dev/nvme0n1p5 1906642944 1953523711 46880768 22.4G 82 Linux swap / Solaris"
    The issue is you have put your ext4 as Linux swap partition (ID 82), you should assign it as ID 83.
    In Clonezilla, we deal with partition ID 82 as swap one, and just create the swap partition for it. No need to image/clonea swap partition. This will have more efficient.

    Steven

     

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.