Visualizzazione post con etichetta cloning. Mostra tutti i post
Visualizzazione post con etichetta cloning. Mostra tutti i post

martedì 5 gennaio 2016

Deploy Windows 8 WIM image

Disclaimer: I'm not responsible for any damage that could  happen to your devices following this guide. It' under your own responsability!

Here a brief description of the steps needed to deploy a W8 WIM image to a BIOS computer:

1. put the WIM image on some sort of USB device (i.e. install.wim)
2. boot the computer with some sort of bootable media that contain DISM (i.e. AIK cd or the W8 installation dvd or AOEMI Backupper or anything else)
3. once booted, from the prompt enter:

select disk 0
clean                                                    <--- be careful! this will erase the content of the disk!!
create partition primary size=350
format quick fs=ntfs label=System
assign letter=S
active
create partition primary
format quick fs=ntfs label=Windows
assign letter=W
exit

Let's say install.wim in in the H: drive in a "win8" folder:

dism /apply-image /imagefile:h\win8\install.wim /index:1 /applydir:w:\

now you have the windows file in the W: disk, we need to make it bootable

bcdboot w:\windows /l it-it /s s: /ALL

reboot the pc it should load now the Windows 8 OS just installed


venerdì 25 novembre 2011

Cannot boot OpenSuse 12 after cloning disk due to by-id access to the disk

Hi all,
today I tried to clone a pc with OpenSuse12 using Clonezilla as cloning solution.
Then I tried to boot the target cloned machine but it wasn't able to boot and the errors was something like this (the disk names are from another post, just as an example) :



Trying manual resume from /dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1
resume device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1 not found (ignoring)
Trying manual resume from /dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1
resume device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1 not found (ignoring)
Waiting for device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 to appear : ........................ Could not find dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 .
Want me to fall back to dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 ? (Y/N)
y
Waiting for device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 to appear : ...............not found -- exiting to /bin/sh




The typical messages are:

Trying manual resume from
resume device dev/disk/by-id/ata-...-part1 not found (ignoring)
Waiting for device dev/disk/by-id/ata-...-part2 to appear
Could not find dev/disk/by-id/ata-...-part2
Want me to fall back to dev/disk/by-id/ata-...-part2 ? (Y/N)


This happens due to a new default setting in OpenSuse: from Ver.10Sp1 on, the new default is to reference the storage device (the disks)  "by-id" instead of by-name

I mean, in the past the disks was referenced like this:
sda
sdb
...


then the partitions of the first disk (sda) was:
sda1
sda2
sda3


and so on.

Now the new way to reference disk and partition is:

The disks are (just an example, it changes based on the disk manifacturer and other data):
/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8

where the first row is the first disk, a Toshiba disk, the second is another disk, a Seagate disk.

The partitions will be, for the first disk, for example:

/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1
/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2

for the second disk:
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part1
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2

The problem with cloning is that around the system, in some configuration files, there are references to the original disks "by-id", unfortunately on the target computer (where we restore the image) the disks will be different, will have different "by-id" name, so linux will be unable to find the disks and boot correctly.

SOLUTION


The solution is quite simple.
After creating the MASTER computer, we need to change 2 files in order to modify the "by-id" reference in "by-name" reference.
The files are:


/etc/fstab
/boot/grub/menu.lst


in both the files we need to find every instance of names like (example)

/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1

and change in something like:

/dev/sda1

take care about the partition number:
-part1  ->  sda1
-part2  ->  sda2

and so on.

To modify those files from a command prompt we need to run the editor using sudo else we will get an error (missing rights):

sudo vi /etc/fstab


(then i to go into insert mode, change the disk name, then press ESC to exit insert mode, then :wq to write the changes to disk and quit, else to discard changes :qa!)

sudo vi /boot/grub/menu.lst


(same instruction as above)

Reboot the computer to check that everything is still working fine.
You are now ready to create the image with Clonezilla (or other cloning solution) and restore on the target pc.


SAMPLE
Here how my files appeared before and after the change:

/etc/fstab
BEFORE


/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part3 /home                ext4       acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0


/etc/fstab
AFTER


/dev/sda1 swap                 swap       defaults              0 0
/dev/sda2 /                    ext4       acl,user_xattr        1 1
/dev/sda3 /home                ext4       acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0



/boot/grub/menu.lst
BEFORE




# Modified by YaST2. Last modification on Fri Nov 25 21:23:32 CET 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader


default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate


###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2 resume=/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part1 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default


/boot/grub/menu.lst
AFTER


# Modified by YaST2. Last modification on Fri Nov 25 21:23:32 CET 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader


default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate


###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/sda2 resume=/dev/sda1 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/sda2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default



bye
Digger