Results 1 to 2 of 2

Thread: [GUIDE][HOW TO] Switching vom HDD to SSD + a fixup

Threaded View

  1. #1

    [GUIDE][HOW TO] Switching vom HDD to SSD + a fixup

    Hello fellow ZENworks users!

    I want to make a quick write up about how we ended with some broken imaged workstations.

    So the problem initially was that we imaged about 50 devices with ZCM 11.3.0 with an imaging script. And although we followed the things our novell partner gave us, we ended up with images on the machines where the system reserved partition of the windows 7 machines was only 22MB (instead f the 100MB recommended). Somewhere the partition got shrinked while imaging. The problems that resulted where that sometimes the machines won't boot.

    The other point at doing this work was that we looked into options to speed up the workstations and the obvious way was to exchange the 7200rpm HDDs for some nice Samsung EVO 850 SSDs.

    Scenario is as follows: The old HDDs hav a capacity of 1TB. But since all the files are stored in a DMS and a storage, the hard drives only contained 60GB of data. So we opted for a cheap solution and got 120GB EVOs. So basically we needed to shrink the volumes to fit onto the 120GB. ZCM Imaging has almost all the tools needed on it.

    Steps taken:
    1. Plug the SSD into the workstation and boot it with the tuxera ntfs driver enabled boot CD into manual mode
    2. Resize the existing NTFS Volume to fit onto the SDD with
      ntfsresize -s 110G /dev/sda2
      -s 110G...sets the size for the existing ntfs container to be shrunken to
      Accept the question if you want to proceed with y
    3. Create the new Partitions on the SSD
      1. fdisk /dev/sdb
      2. n -> p -> 1 -> 2048 -> +100M
        n...new partition
        p...primary partition
        1...partition number
        2048...starting block
        +100M...Endblock at 2048 + 100M
        So this creates the small 100MB partition that is titled "system reserved" in Windows
      3. n -> p -> 2 -> default value -> default value
        this creates the second partition with all the data and fills the whole disk when you use the default values
      4. t -> 1 -> 7
      5. t -> 2 -> 7
        thos commands set the filesystem type to HPFS/exFAT/NTFS which is needed to use it with tuxeras ntfs drivers
      6. a -> 1 -> w
        set the boot flag on the first partition and write everything to the partition table

    4. Format the newly created partitions to plain NTFS via
      mkfs.ntfs /dev/sdb1
      mkfs.ntfs /dev/sdb2
    5. Now instead of dd-ing the raw block data I used ntfsclone which actually just clones the used data (it copies in filesystem level not block level)
      ntfsclone --force --overwrite /dev/sdb1 /dev/sda1
      ntfsclone --force --overwrite /dev/sdb2 /dev/sda2

      --force...is needed since we resized the source partition with ntfsresize in point 2
      --overwrite...just to make sure we are not keeping anything existing
      the source and destination parameters are switched as per documentation
    6. Now the raw data is on the drive but we need to also copy over the bootloader portion of the MBR
      dd if=/dev/sda of=/dev/sdb bs=446 count=1
      if...source (the HDD)
      of...destination (the SSD)
      bs...the MBR arethe fir 446 bytes of the drive
      count...only do it once
    7. now all the data shifting is done and you need to Boot the machine with the Windows 7 Repair Disk (I downloaded an iso made a bootable USB stick)
      So shutdown the PC and pull out the HDD and connect the SSD to the correct SATA port
    8. the repair program wiill recognise a broken windows installtion and try to fix it. Do not the accept the question to let Windows repair it automatically and instead go for the recovery tools.
    9. Now we can use the Windows commandline tools to fix up the MBR/BCD/BOOT stuff
      bootrec /rebuildbcd
      bootrec /fixmbr
      bootrec /fixboot

    Reboot the workstration and let chkdsk do its thing. The chkdsk ist scheduled by the ntfsresize from point 2.

    So there we have it: we got all of the data from one HDD to the other and expanded the broken system partition.

    I hope for someone else this can be needy. It solved some not booting up machines on our site.

    Another thing I want to add is that we fixed a few other things as well:
    - When Imaging with ZCM the Imaging engine uses 63 as the starting block for the first partition. I don't know but the 2048 look much cleaner and more sane
    - with the 22MB system reserved partition we had and NTFS entry in the event log which would cause the PC to have troubles booting some times
    - I did the whole process with ZCM 11.3.2 TNTFS enable Boot CD and it took about 20minutes per machine

    Regards Sebastian
    Last edited by s_vogel; 21-May-2015 at 02:14 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts