Menu

Cloning w/ Win10 issues

Help
2018-08-21
2019-02-11
  • Grant Nasset

    Grant Nasset - 2018-08-21

    Hello,

    My company is currently upgrading to Windows 10 and currently uses Clonezilla to put our base image on all of our PCs.

    I have just created our base image using Operating System Windows Enterprise N (64bit) on a 120GB HDD. When I go to put this on a 500GB HDD it is not only showing that the drive is 120GB. I said no probem i'll just expand is using diskmgmt. Nope showed that the there is no space to expand.

    What did I do wrong? and What can I do now. Thanks :)

     
  • Yunnan

    Yunnan - 2018-08-23

    You can use GParted to fix that issue -- after it boots, you can select 'Fix' from the first window that pops up, reboot, and extend as normal from diskmgmt / diskpart (extend). You can also extend the partition / volume from within GParted.

    Alternatively, you can use the shell in CloneZilla to fix that issue (I use the same commands as postrun options for automated stuff), although, I am not entirely sure if it's recommended or proper, but it has been working for me.

    Let's say the HDD to fix is /dev/sda, and the partition layout is the default UEFI partition layout for Win10 -- 4 partitions, with the 4th partition (/dev/sda4) being the main Windows partition:

    sudo parted /dev/sda print Fix
    (if you choose to stop here, this command alone will 'unlock' the ability to extend the volume from within diskmgmt / diskpart in Windows)

    If you want to keep going and extend the last Win10 UEFI partition (/dev/sda4) from within CloneZilla:

    sudo parted -s /dev/sda resizepart 4 100%

    sudo ntfsresize -v -ff /dev/sda4

    sudo ntfsfix -d /dev/sda4

    If you want to use those in a postrun situation with grub.cfg or syslinux.cfg, this has been working for me:

    ocs_postrun1="sudo parted /dev/sda print Fix" ocs_postrun2="sudo parted -s /dev/sda resizepart 4 100%" ocs_postrun3="sleep 2" ocs_postrun4="sudo ntfsresize -v -ff /dev/sda4" ocs_postrun5="sudo ntfsfix -d /dev/sda4"

    My reason for doing this is similar to yours, I have a bunch of laptops that use a common image, but some ship with small SSD's and some with larger HDD's. It seemed silly to create an image for two disk sizes, and this is what I came up with after reading around.

    Just remember to change the /dev/sdX or /dev/sdXX to match your hdd and partition number. If you have a 2nd partition or recovery partition at the end of the disk / image, you'd have to re-jig those commands to suit your fancy.

     
  • Roger H

    Roger H - 2019-02-08

    I've been playing with an expect script to do the same thing, as the parted command isn't seeming to take the Fix (I'll try again).

    We are adding in some NVME into the mix too, so I was hoping to get the ask_user output to tell me which drive was targeted, so I can then run the script automagically.

     
  • Roger H

    Roger H - 2019-02-11

    OK.. so in my most recent test ocs_postrun1="sudo parted /dev/sda print Fix" does NOT work -- the fix does not come in on the command line.

     
  • Roger H

    Roger H - 2019-02-11

    I was able to do an expect script which ran through the print/resize option correctly.

    Working on tweaking it for the nvme case now.

     
  • Roger H

    Roger H - 2019-02-11
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    #!/usr/bin/expect -f
    
    set force_conservative 0  ;# set to 1 to force conservative mode even if
                  ;# script wasn't run conservatively originally
    if {$force_conservative} {
        set send_slow {1 .1}
        proc send {ignore arg} {
            sleep .1
            exp_send -s -- $arg
        }
    }
    
    set timeout -1
    spawn parted /dev/sda
    match_max 100000
    expect "(parted) "
    send "print\r"                                                                                                                         
    expect "Fix/Ignore? "
    send "f\r"
    expect "(parted) "
    send "quit\r"
    puts "sda resized"
    puts "Press 'c' to continue"
    while 1 {
        interact "c" {puts "Finished.";break}
    expect eof
    

    what would be awesome is if the ocs-r output could be parsed so I could replace that /dev/sda element automatically.

     

    Last edit: Roger H 2019-02-11

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.