2

I had the following configuration of partitions on old 160GB disk:

/sda
  /sda1 - 100MB  - NTFS - System Recovery (hidden Windows partition)
  /sda2 - 75GB   - NTFS - Windows
  /sda3 - extended partition
    /sda5 - 75GB - EXT4 - Debian
    /sda6 - 8GB  - swap - swap partition

I used GPart to prepare new 500GB disk with identical order of corresponding partitions but different size (and 1 additional partition at the and) - I intended to clone them one by one with Clonezilla:

/sda
  /sda1 - 100MB   - NTFS - System Recovery (hidden Windows partition)
  /sda2 - 160GB   - NTFS - Windows
  /sda3 - extended partition
    /sda5 - 160GB - EXT4 - Debian
    /sda6 - 32GB  - swap - swap partition
    /sda7 - 110GB - NTFS - additional partition

Up till now everything worked as expected. I cloned old sda1 into new sda1, old sda2 into new sda2 and old sda5 into new sda5. It didn't cloned bootloaded and I had to restore it manually with some live CD:

mount /devsda5 /mnt
--bind /dev /mnt/dev
--bind /proc /mnt/proc
--bind /sys /mnt/sys
chroot /mnt
grub-install /dev/sda5
update-grub

It correctly detected kernels I had installed as well as Windows partition.

Problem manifested when I tried to boot into Debian. Booting with newest kernel got stuck at Loading please wait... screen. Booting in problem resolving mode got stuck at Running /script/local-premount. Similarly attempt to boot Windows ends with message about corrupted installation.

Surprisingly I am able to boot into Debian using older kernel (currently on Jessie previous kernel from Wheezy). However, in this case no other partition can be mounted, even those which are stored on another physical drive, which couldn't be affected by the process since it was removed from the computer at a time.

What could be the source of the problem? What information could I provide to help figuring it out?

EDIT:

I managed to learn that boot of newest kernel without quiet option shows the same results as recovery mode. After waiting some time (several minutes) I've got another message:

Begin: Running /scripts/local-premount ... resume: Could not stat the resume device file: '/dev/disk/by-uuid/[uuid]'
        Please type in the full path name to try again
        or press ENTER to boot the system:

After I pressed enter system finally booted. However it turns out the partition it is missing is the swap partition:

$cat /proc/meminfo | grep Mem # I have 8GBs of RAM
MemTotal:        8154632 kB
MemFree:         1367032 kB
MemAvailable:    4750344 kB
$ cat /proc/swaps
Filename                Type        Size    Used    Priority
/dev/sda6                               partition   33554428    0   -1

Where can I make sure that partition is actually used?

2
  • Thanks for sharing this, +1. You should specify the windows version though. Commented Jul 9, 2015 at 18:59
  • I use Windows 7 Professional N, but problem with Windows would most likely occur on all NT descendants. Only solution is 7-specific though I believe solution for other versions would be almost identical. Commented Jul 9, 2015 at 22:08

1 Answer 1

2

There were several things wrong after I cloned partitions, none of which I was aware.

  1. on Linux several programs rely on device UUID instead of /dev/sdX notation. As a matter of a fact in e.g. /etc/fstab it is the recommended way. In my case that were entries concerning swap partition, as a result initializing script got stuck at mounting it for a while before giving up and moving on.

    With grep -r [UUID] / I found all places where old swap partition was used. I replaced the value to one matching sudo blkid in files:

    /etc/blkid.tab                # swap partition
    /etc/uswsusp.conf             # hibernation device
    /var/cache/debconf/config.dat
    /etc/initramfs-tools/conf.d/resume
    

    Then I had to make sure that those values landed in initrc scripts. It could be done by calling them manually or (in my case) by uninstalling and installing uswsusp again (swap partition is also used to store hibernation data).

    After that swap partition loaded correctly and boot was quick.

  2. on Windows System Restore partition was cloned but not marked active - as a result System Repair Tools couldn't detect it and fix MBR setup. I had to:

    • open command line (for unknown system),
    • run diskpart,
    • figure out right disk with list disk and select it with select disk [NUMBER],
    • figure out right partition with list partition and select it with select partition [NUMBER],
    • marking current partition as active with active,
    • restart, load System Repair Tools again and let them fix everything (bootrec /fixmbr and bootrec /fixboot might come in handy).
  3. Of course in the meantime I had to restore Grub because I didn't clone it:

    mount /dev/sda5 /mnt
    mount --bind /dev /mnt/dev
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    chroot /mnt
    grup-install /dev/sda5
    update-grub 
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .