How to make an exact copy of Windows XP bootable cd using dd command in linux to an usb flash drive so to be able to use the flash drive to install XP in a netbook.
3 Answers
You don't. Not with dd.
Some linux distributions have special hybrid isos that are sufficiently valid as both a bootable cd and a bootable disk so you can copy one to the other and use the same image, but cd and flash stick booting protocols are different and incompatible. I think flash drives boot similarly to hard drives and floppy discs, at least in the BIOS (non-efi) versions.
I think I have seen software that can convert XP installation cd to a usb stick, but it needs to do non-trivial alterations.
Maybe Rufus would work, as @AntoineL commented.
Also, relevant answer from sidebar: Installing Windows XP from USB pen drive.
Edit: If you don't have a Windows host, you could try wine, maybe with some fiddling to access the drive properly. Or a windows OS on VirtualBox, if you have the RAM for it. You can use windows from the installation CD, download freely virtual images available images from Microsoft or many other options.
- 188
-
I don't know much about booting so i thought cd and flash drive booting protocols are the same, i am not sure if it is possible to make the pc think the usb drive is a sort of cd i mean the flash will mimic a cd filesystem, is this possible ? – P. Kod Mar 13 '18 at 00:18
-
@P.Kod A flash can have a cd filesystem (though Windows might not accept it), but the method of hardware access and the boot process is quite different. You need different drivers, probably bootloader and configuration. – Ivan Mar 13 '18 at 10:04
-
I used Rufus as AntoineL suggested but it didn't work, i don't know why because in the link you posted they say Rufus can create windows Xp installer, i used a 4GB flash disk and Windows bootable image ISO. – P. Kod Mar 13 '18 at 18:17
AFAIK Windows cannot be copied this way. It needs some special treatment and I haven't found any programs (half a year ago) on Linux that are able to do so.
dd command will run succesfully but you won't be able to install any Windows from that flash drive. Your safest bet is doing it on Windows.
-
You are right 'dd' run successfully but the flash drive can't boot even if it contains the same exact copy of the disc, i don't know how to modify usb mbr in linux to make it boot windows XP. – P. Kod Mar 13 '18 at 00:03
I solved my problem, i created a winpe flash drive and copied into it the I386 folder from the windows XP cd which contains the sata drivers, if your copy of XP doesn't contain Sata drivers you can add them by using nlite (use an old version because they are virus-free).
When you boot WinPE, browse to the I386 folder and run the winnt32.exe by typing this command
F:\I386\winnt32.exe /makelocalsource /noreboot /syspart:C: /tempdrive:C:
where F: is Flash disk letter and C: is the primary active partition, make sure you previously formatted and made the C: partition active using the command diskpart.
If you want to install windows XP by using the linux command dd the only way you can achieve this is by installing windows XP in a small disk and image that disk with dd, now with that image you can, every time you wish, apply it to your hardware and extend it to the full disk space, see here how to extend volumes KB325590
- 63
I386\winnt32.exe. PE is harder to set up and pickier for the ISO, Linux is easier until starting the .exe – AntoineL Mar 13 '18 at 18:45I386\winnt32.exehow to exactly write the syntax for installing Windows XP and should i copy the I386 folder only or the entire folders contained in the iso ? – P. Kod Mar 13 '18 at 20:18I386\winnt32.exe /noreboot /s:"path to I386 folder"the problem is i get missing bootmgr after reboot, i didn't add sata drivers because i don't find it in hp support second i don't know where to put the files, people seems to use nlite but i prefer to copy the drivers myself. I searched a lot and didn't find information about the folder i should put the sata drivers in, if you want still to continue helping me i would be thankful, i never imagined windows XP is obstinate. – P. Kod Mar 14 '18 at 21:52bootrec(unfortunately). There are two small utilities, available in the recovery console,fixmbrandfixboot; but installing and starting the recovery console itself is exactly what you want (it cannot be installed on USB). Once you are in WinPE, you can runbootrec /FixMBRthenbootsect /NT52 α:and copyNTLDRin the root directory to restore booting. The equivalent of the BCD is the text fileBOOT.INI, it is easier to manage; the equivalent of bcdboot is notepad! – AntoineL Mar 15 '18 at 14:27C:drive, i have run winnt32 from the flash disk directly using this command:F:\I386\winnt32.exe /makelocalsource /noreboot /syspart:C: /tempdrive:C:whereF:is Flash disk letter andC:is the primary active partition in the hard disk. On reboot WinXP started but i encountered blue screen cause of Sata drivers. Now i consider first part of my thread solved, back to my dd command how can i copy C: files with dd and then in future restore WinXP using dd ? this seems easier than applying WinXP iso to hard disk. – P. Kod Mar 15 '18 at 21:01dd, let me do a quick recap at XP installation (in fact NT 3.x/4/5.x): first phase is runningwinnt[32]one way or another, it installs the minimum startup engine on the target, assuring that it will boot at next restart and also make available al the needed material for the next phase; then a reboot is needed. – AntoineL Mar 16 '18 at 07:48I386source (which could have been copied in the preceding step, exactly what your found); there are very little space for interaction here, albeit "F6" integration of mass storage drivers and TEXTMODE.OEM should be noted. At the end, there are no other choice than to do a reboot. Third step is the GUI part of the installation. Where in this sketch want youddto operate? – AntoineL Mar 16 '18 at 07:53I386\$OEM$\$$\INFandI386\$OEM$\$1\drivers\IntelINFthen copy the INF files into the first folder and copy INF and .CAT files into the second folder and finally edit the so called answer fileUNATTEND.TXTby doing this[Unattended] OemPreinstall = Yes OemPnPDriversPath="drivers\IntelINF"So i think this is what nlite and similar software are doing. – P. Kod Mar 16 '18 at 23:21dd, i just mean in case i have finalized installing WinXP will it be possible to copy the new installed OS ? the correct term is making an image of the OS (but not the whole C: drive) so in future when i want to reinstall XP i will just run dd in my linux partition and copy the clean image to C: drive again, it will be better than doing all this things again with WInPE. I hope it's clear now, thank you for your answers it really helped me a lot, i will resume this in an answer when i finish reading about automating windows setup – P. Kod Mar 16 '18 at 23:34ddI do not know, problem are NTFS metadata. I believe you need to first install XP in a very small disk and image that withdd. On restore, after runningddon the same hardware, you then need to extend the disk to the full available disk space: read KB325590 to learn how; GNUPart should be able to do that as well, although I never tried. Should work; but starting from installed XP, not from the boot CD. – AntoineL Mar 21 '18 at 08:42