NTFS clone and Sysprep

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NTFS clone and Sysprep

Al Grant
Hi All,

I have a Windows XP sysprep image (about 5Gig in size) that I want to put on a new disk.

I run ms-sys to install MBR.

cfdisk to create a partition using whole disk and type NTFS.

Then fdisk to flag it as bootable.

Then ntfsclone to send the sysprep img to /dev/sdb1 - that all goes ok.

Problem comes when I go to put the hard disk in a host computer and boot it I get "A disk read error has occured".

Somewhere along the line I am screwing it up.

Any suggestions?


Thanks

-Al
Reply | Threaded
Open this post in threaded view
|

Re: NTFS clone and Sysprep

Anton Altaparmakov
Hi,

What you are describing is nowhere near sufficient!

- You need to update the hidden sectors field in the NTFS boot sector.

- You need to update boot.ini in the NTFS root directory to reflect that this is the first partition of the first disk (assuming it is the first disk otherwise edit as appropriate).

- If the hardware is different to the one the image was created on you might need to change things like the HAL driver/DLL, the storage controller driver, etc and then you need to make corresponding changes in the registry.

Good luck!

Best regards,

        Anton

On 12 Jul 2011, at 01:13, Al Grant wrote:

>
> Hi All,
>
> I have a Windows XP sysprep image (about 5Gig in size) that I want to put on
> a new disk.
>
> I run ms-sys to install MBR.
>
> cfdisk to create a partition using whole disk and type NTFS.
>
> Then fdisk to flag it as bootable.
>
> Then ntfsclone to send the sysprep img to /dev/sdb1 - that all goes ok.
>
> Problem comes when I go to put the hard disk in a host computer and boot it
> I get "A disk read error has occured".
>
> Somewhere along the line I am screwing it up.
>
> Any suggestions?
>
>
> Thanks
>
> -Al

--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Linux-NTFS-Dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/linux-ntfs-dev
Reply | Threaded
Open this post in threaded view
|

Re: NTFS clone and Sysprep

Al Grant
Thanks for the reply Anton. I knew it would'nt be easy but I am learning as I go.

Any chance you could please expand on these answers as I dont know how to update the hidden sector field.

Also I have added a truck load of drivers to the sysprep image and also set the ACPI to a type that is very compatiable with most computers. I find the image works 90% of the time.

Regards,

-Al




Anton Altaparmakov wrote
Hi,

What you are describing is nowhere near sufficient!

- You need to update the hidden sectors field in the NTFS boot sector.

- You need to update boot.ini in the NTFS root directory to reflect that this is the first partition of the first disk (assuming it is the first disk otherwise edit as appropriate).

- If the hardware is different to the one the image was created on you might need to change things like the HAL driver/DLL, the storage controller driver, etc and then you need to make corresponding changes in the registry.

Good luck!

Best regards,

        Anton

On 12 Jul 2011, at 01:13, Al Grant wrote:

>
> Hi All,
>
> I have a Windows XP sysprep image (about 5Gig in size) that I want to put on
> a new disk.
>
> I run ms-sys to install MBR.
>
> cfdisk to create a partition using whole disk and type NTFS.
>
> Then fdisk to flag it as bootable.
>
> Then ntfsclone to send the sysprep img to /dev/sdb1 - that all goes ok.
>
> Problem comes when I go to put the hard disk in a host computer and boot it
> I get "A disk read error has occured".
>
> Somewhere along the line I am screwing it up.
>
> Any suggestions?
>
>
> Thanks
>
> -Al

--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Linux-NTFS-Dev mailing list
Linux-NTFS-Dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-ntfs-dev
Reply | Threaded
Open this post in threaded view
|

Re: NTFS clone and Sysprep

Al Grant
In reply to this post by Al Grant
Hi Guys,

Here is what I have been trying (very badly) to get the sysprep image onto a disk;

al@al-ubuntu:~$ clear

al@al-ubuntu:~$ sudo fdisk -l
[sudo] password for al:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 2435 19551167+ ee GPT
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 2435 19551167+ ee GPT
al@al-ubuntu:~$ clear

al@al-ubuntu:~$ sudo fdisk /dev/sdb

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help):
Command (m for help): p

Disk /dev/sdb: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 2435 19551167+ ee GPT

Command (m for help): d
Selected partition 1

Command (m for help): 1
1: unknown command
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
al@al-ubuntu:~$ partprobe
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 20.0 GB, 20020396032 bytes
64 heads, 32 sectors/track, 19092 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
al@al-ubuntu:~$ clear

al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 83 Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 20.0 GB, 20020396032 bytes
64 heads, 32 sectors/track, 19092 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
al@al-ubuntu:~$ cfdisk

al@al-ubuntu:~$ sudo cfdisk

al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 7 HPFS/NTFS

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 20.0 GB, 20020396032 bytes
64 heads, 32 sectors/track, 19092 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
al@al-ubuntu:~$ sudo cfdisk

al@al-ubuntu:~$ sudo cfdisk /dev/sdb

al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 7 HPFS/NTFS

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 20.0 GB, 20020396032 bytes
64 heads, 32 sectors/track, 19092 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19092 19550192 7 HPFS/NTFS
al@al-ubuntu:~$ sudo ms-sys -m /dev/sdb1
/dev/sdb1 seems to be a disk partition device,
use the switch -f to force writing of a master boot record
al@al-ubuntu:~$ sudo ms-sys -m /dev/sdb
Windows 2000/XP/2003 master boot record successfully written to /dev/sdb
al@al-ubuntu:~$ sudo ntfsresize -s 17G /dev/sdb1
ntfsresize v2.0.0 (libntfs 10:0:0)
ERROR: Device '/dev/sdb1' is mounted read-write. You must 'umount' it first.
al@al-ubuntu:~$ umount /dev/sdb1
al@al-ubuntu:~$ sudo ntfsresize -s 17G /dev/sdb1
ntfsresize v2.0.0 (libntfs 10:0:0)
Failed to startup volume: Invalid argument.
ERROR(22): Opening '/dev/sdb1' as NTFS failed: Invalid argument
The device '/dev/sdb1' doesn't have a valid NTFS.
Maybe you selected the wrong partition? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? This error might also occur
if the disk was incorrectly repartitioned (see the ntfsresize FAQ).
al@al-ubuntu:~$ sudo ntfsclone -rO /dev/sdb1 /home/al/shared/XP_SP3_OEM.img
ntfsclone v2.0.0 (libntfs 10:0:0)
ERROR: Output device is too small (78643200) to fit the NTFS image (5034179072).
al@al-ubuntu:~$ sudo ntfsresize -s 17G /dev/sdb1
ntfsresize v2.0.0 (libntfs 10:0:0)
Failed to startup volume: Invalid argument.
ERROR(22): Opening '/dev/sdb1' as NTFS failed: Invalid argument
The device '/dev/sdb1' doesn't have a valid NTFS.
Maybe you selected the wrong partition? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? This error might also occur
if the disk was incorrectly repartitioned (see the ntfsresize FAQ).
al@al-ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf010487

Device Boot Start End Blocks Id System
/dev/sda1 * 1 121601 976760001 7 HPFS/NTFS

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 20.0 GB, 20020396032 bytes
64 heads, 32 sectors/track, 19092 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19092 19550192 7 HPFS/NTFS
al@al-ubuntu:~$ sudo ntfsresize -s 17G /dev/sdb1
ntfsresize v2.0.0 (libntfs 10:0:0)
Failed to startup volume: Invalid argument.
ERROR(22): Opening '/dev/sdb1' as NTFS failed: Invalid argument
The device '/dev/sdb1' doesn't have a valid NTFS.
Maybe you selected the wrong partition? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? This error might also occur
if the disk was incorrectly repartitioned (see the ntfsresize FAQ).
al@al-ubuntu:~$

HTH?

-Al
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Linux-NTFS-Dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/linux-ntfs-dev