Four Vista/Windows-7 installation DVDs in one flash drive


Results 1 to 5 of 5

Thread: Four Vista/Windows-7 installation DVDs in one flash drive

Hybrid View

  1. #1
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,961

    Four Vista/Windows-7 installation DVDs in one flash drive

    How to Transfer 4 versions of Vista and Windows-7 installation DVDs into a flash drive

    Edited 18/6/10 --- I have discovered a method to put the installation DVDs and boot each one from a logical partition. This remove the limitation of 4 installation DVD. You can have as many as you want limited by only the flash drive capacity. More details shown in Post #5

    Introduction

    The recent versions of MS Windows of Vista and Windows 7 installers support booting from a USB device so it is possible to transfer the contents of the installation DVD to a flash drive and use it for booting.

    A USB flash drive however is classified by M$ as a “Super floppy” that can only have one partition. This means one flash drive can store one MS Windows boot loader.

    This tutorial shows how to use Grub, a Linux boot loader, to boot 4 Vista/Windows 7 installation in one flash drive.

    Technical consideration

    (1) I have checked to my satisfaction that none of the MS Windows of Win2k, Xp, Vista and Win7 can mount or see more than one partition in a flash drive. That doesn't mean the user can't have multiple partitions. It is just MS systems have been engineered to mount the first one it recognises and disregards the rest.

    (2) MS Windows installers of Vista and Win7 do not like to be booted from a logical partition. As a flash drive with a Msdos partition table can have a maximum 4 primary partitions hence this tutorial describes 4 versions of MS Windows installers of Vista Home-32, Win7 Ultimate-32, Vista Home-64 and Win7 professional-64.

    (3) Grub accomplishes the booting process by unhiding the partition it is asked to boot and hiding the remaining 3 primaries. The hiding only alter the partition Type number in fooling the installer thinking the hidden partitions being foreign. MS system command “diskpart” has a similar facility by “setid” doing exactly the same thing. Grub can do this during boot time whereas diskpart can only operate after an installer or a MS Windows has been booted up first.

    (4) Every MS system, from Dos to Win7, has a boot sector code deposited in the reserved boot sector of the partition it resides in. Technically it become possible for another boot loader to load the boot sector code and hand over the control to the MS system. This is one boot loader booting another one, a technique called “chainloading" used by virtually all reputable boot loaders. MS Win2k/Xp's NTLDR and Vista/Win7's bootmgr boot other operating systems with the same technique. The scheme described here is install the boot sector code of bootmgr in each primary partition of the flash drive. Grub is fired up first and then asked to hand over the control to this boot sector code which responsible for loading the Vista/Win7 common boot loader bootmgr. It is bootmgr that fires up the installer program.

    (5) Vista and Win7 has a program “bootsect.exe” stored in every \boot directory of the installation DVD. To generate a boot sector code for boomgr, say to the drive D: is simpy
    Code:
    bootsect.exe /nt60 d:
    Outline of the scheme

    (i) Format the flash drive into 4 primary partitions. This is done in Linux with a Live CD as Linux mount all partitions and has a far more powerful set of utilities.

    (ii) Copy the contents of each MS Windows installation DVD into each partition of the flash drive. This can be done either in Linux (or MS Windows if using a USB hard disk as an interim storage with which all 4 primaries can be mounted, otherwise one partition at a time with a pen drive)

    (iii) Write the boot sector code in each primary partition. This operation can only be done with an installation DVD or using an installed 64-bit MS Vista or Win7.

    (iv) Arrange the booting process. This involves using Linux. Only the boot loader Grub is installed but its location can be in a floppy, with the flash drive, in a CD/DVD or any of the hard disk partition.

    Essential steps or commands


    I list all the essential commands with brief explanations.

    (A) To create a Linux bootable CD.
    - to be done in MS Windows or any OS.

    This requires a user to download an iso file free from an Internet site and burn the image file to a bootable CD. I suggest Mepis, downloadable from here from DistroWatch.com, as it has Grub1 inside. The most popular Linux is Ubuntu but it has moved to Grub2 which is more difficult to use. Ubuntu, if internet-able, can also be used if the user replace the Grub2 with Grub1 by adding it with the command
    Code:
    sudo apt-get install grub
    (B) Boot up Mepis Live CD, claim the root privilege (equivalent to Admin rights in MS Windows)
    Code:
    su
    Mepis will ask for the root password which for a Live CD is just “root”. If Ubuntu is used the "su" is replaced by "sudo su" and Ubuntu doesn't demand a password if it is a Live CD.

    Then do a sanity check to show up all disks and partitions by command
    Code:
    fdisk –l
    The above displays the device names of every partition.

    (C) Formatting the partitions
    - shown here done in Linux but can be done in Windows

    There are many partitioning tools in Linux. I used a script, equivalent to a batch file in Dos, to do the partitioning. First I entered this line in terminal
    Code:
    echo ",393,7" >a2 ;echo ",393,7" >>a2 ;echo ",654,7" >>a2;echo ",523,7" >>a2
    which produces a text file called “a2” representing the key strokes I would have to use with the program “sfdisk” in Linux. The 393, 393, 654 and 523 are the number of cylinders in the 4 primary partition which I specified with Type “7” signifying the NTFS filing type. The partitioning command is just
    Code:
    sfdisk /dev/sdc< a2
    producing the following partition table
    Code:
    Disk /dev/sdc: 400.1 GB, 400088457216 bytes
    255 heads, 63 sectors/track, 48641 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: 0x00017ff8
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1         393     3156741    7  HPFS/NTFS
    /dev/sdc2             394         786     3156772+   7  HPFS/NTFS
    /dev/sdc3             787        1440     5253255    7  HPFS/NTFS
    /dev/sdc4            1441        1963     4200997+   7  HPFS/NTFS
    on a 400Gb USB external hard disk temporarily. MS Windows mounts every partition if it is a hard disk in the USB connection. I was just make use this feature to accelerate the process. I shall show how the finish product can be copied to a USB flash drive in one operation.

    The use of a USB hard disk as an interim storage is optional but it amkes life a lot easier.

    The above partitions sizes, approximately 3.2Gb, 3.2Gb, 5.3Gb and 4.3Gb were selected to accommodate the 32-bit Vista, 32-bit Win7, 64-bit Vista and 64-bit Win7 respectively, after checking their DVD contents. One cylinder is 255 heads x 63 sectors x 512 bytes per sector giving 8.225Mb.

    Linux separates the partition creation with formatting. The former is reversible but the latter is irreversible. The formatting in Linux is conducted on the device which cannot be mounted yet as it has no filing system yet.
    Code:
    mkfs.ntfs -f -L Vista-32 /dev/sdc1
    mkfs.ntfs -f -L Win7-32 /dev/sdc2
    mkfs.ntfs -f -L Vista-64 /dev/sdc3
    mkfs.ntfs -f -L Win7-32 /dev/sdc4
    In the above I opted for a “fast” format and added a “Label” to each partition to help me identify them.

    Now with a filing system inside these blank partitions can be mounted for accepting the DVD data.

    Linux uses the /mnt for the mounting purpose so I made 4 mounting points, one per partition, in the /mnt directory and mounted the appropriate devices or partitions.
    Code:
    mkdir /mnt/sdc1
    mkdir /mnt/sdc2
    mkdir /mnt/sdc3
    mkdir /mnt/sdc4
    mount /dev/sdc1 /mnt/sdc1
    mount /dev/sdc2 /mnt/sdc2
    mount /dev/sdc3 /mnt/sdc3
    mount /dev/sdc4 /mnt/sdc4

    (D)Transferring the content of the installation DVDs to the partitions
    - shown in Linux here but can be done in Windows

    By placing one DVD after the other
    Code:
    cp -R /media/UDF\ Volume/* /mnt/sdc1
    cp -R /media/UDF\ Volume/* /mnt/sdc2
    cp -R /media/UDF\ Volume/* /mnt/sdc3
    cp -R /media/UDF\ Volume/* /mnt/sdc4
    In the above the terminal will not accept my command until the copying operation is complete. The CD/DVD drive has been mounted automatically by Linux under the name of “UDF Volume” in /media directory.

    I have now transferred the 4 Vista and Win7 DVDs into the 4 primary partitions of a USB hard disk.

    (E) Write boot sector code in each primary partition. - must be done in MS Windows

    I need to run bootsect.exe with this Windows-only operation with the USB disk. It can be done inside a 64-bit Win7's Command Prompt or by booting up a 64-bit Win7 or Vista DVD, opt for “Repair” and select “Command Prompt”.

    In a Vista/Win7 Command Prompt, which is equivalent to the terminal mode in Linux or Recovery Console in XP installation CD, one has to check the partition drive letters first. The labels I entered during the formatting enable me to identify them as drive j:, l:, m: and n: respectively. I then issued these commands to write each system's own boot sector code in its own partition. The 32-bit bootsect.exe does not work on 64 bit version so it pays to use each system's own bootsect.exe.
    Code:
    j:\boot\bootsect.exe /nt60 j:
    l:\boot\bootsect.exe /nt60 l:
    m:\boot\bootsect.exe /nt60 m:
    n:\boot\bootsect.exe /nt60 n:

    (F) Clone the USB hard disk into the flash drive.
    - can be done in any Linux but requires third party software if done in Windows

    This has to be done easily in any Linux as it has a command called “dd” that could do a sector-to-sector copying. When booted up a Linux Live CD with my 400Gb USB hard disk and the 16Gb USB flash drive were identified as devices /dev/sdc and /dev/sdd. The cloning operation is just one line of command but it can only be issued after booting up Linux, opt for a terminal and claim root privilege.
    Code:
    dd if=/dev/sdc of=/dev/sdd bs=32256
    The command “dd” here is instructed to read from an input file sdc, which is the 400Gb USB hard disk and write the data on an output file sdd, which is the 16Gb USB flash drive, using block size 32256 bytes. One complete track of 63 sectors times 512 bytes per sector is 32256 bytes I specified here as one record.

    “dd” will attempt to read all 400Gb hard disk and put the same on the 16Gb flash drive but it has to stop with an error when the room for writing has been exhausted in the 16Gb device. The partitions I have created in the 400Gb hard disk is less than 16Gb so the rest is just empty space.

    I used the above technique because it is simple. When the first record, which should be 63 sectors of 512 bytes, is cloned the MBR of the 400Gb hard is faithfully duplicated on the 16Gb flash drive. “dd” does not copy files. It copies the binary bits in the hard disk and so the boot sector codes are automatically transferred.

    On completion I have a healthy and sound flash drive ready to boot up any of the 4 Vista and Win7 installation DVD. All I need now is how to boot it.

    (G) To arrange booting arrangement
    - Only done in Linux and the reason of this thread

    The easiest way to boot the fully populated flash drive is by a Grub floppy. This is because one does not have to bother with the Bios at all if the floppy is the first bootable device.

    Here are the steps to make a bootable Grub floppy, involving copying just two files, called stage1 and stage2 normally residing in the /boot/grub directory of a Linux that has Grub1. In a terminal with root privilege and a spare 1.44Mb floppy in the drive the method published by GNU/Grub Manual is
    Code:
    dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
    dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1
    The GNU/Grub method produce a floppy without a filing system. So it is only usable for booting purpose. My own method involves the following steps but the floppy is formatted and can be used for storage.
    Code:
    mkdosfs -F12 /dev/fd0
    mkdir /mnt/fd0
    mount /dev/fd0 /mnt/fd0
    mkdir /mnt/fd0/boot
    mkdir /mnt/fd0/boot/grub
    cp /boot/grub/stage* /mnt/fd0/boot/grub/
    At this point the floppy isn't bootable yet. To make it bootable I need to put the boot sector code in the floppy by invoking a Grub shell at the Linux terminal and set up Grub, by these commands
    Code:
    grub
    root (fd0)
    setup (fd0)
    quit
    The above floppy can accept a booting menu which can be created by an text editor. The filename must be menu.lst and has to be stored in the /boot/grub directory of the floppy. It is very easy to create one. I have assumed my flash drive as the 4th disk in the PC but a user can adjust for his/her situation accordingly.

    Grub1 counts disks and partitions from zero. First disk is (hd0), second disk is (hd1) etc. The second digit is attached denotes the partition number. Therefore the 1st partition of the first disk is (hd0,0) and the 2th partition of the 4th disk is (hd3,1). Since my flash drive is the 4th disk so my 4 choices of booting the 4 installation DVD will be like, using a Linux terminal editor like
    Code:
    nano /mnt/fd0/boot/grub/menu.lst
    to have the following entries
    Code:
    title Vista 32-bit in first primary of 4th disk
    unhide (hd3,0)
    root (hd3,0)
    chainloader +1
    
    title Win7 32-bit in second primary of 4th disk
    hide (hd3,0)
    unhide (hd3,1)
    root (hd3,1)
    chainloader +1
    
    title Vista 64-bit in third primary of 4th disk
    hide (hd3,0)
    hide (hd3,1)
    unhide (hd3,2)
    root (hd3,2)
    chainloader +1
    
    title Win7-64-bit in fourth primary of 4th disk
    hide (hd3,0)
    hide (hd3,1)
    hide (hd3,2)
    unhide (hd3,3)
    root (hd3,3)
    chainloader +1
    In the menu there is no need to hide with the partitions after the one to be booted because Vista and Win7 would not mount them.

    I provide the booting alternative with a Grub floppy because it is the most convenient method of booting. When Grub is loaded it will try to execute the menu.lst if it is available. If it is not found or defective then Grub defaults to a Grub prompt. In a Grub prompt one can boot up each MS Windows installer “manually”! The commands in the above menu.lst are actually the manual commands required by typing one line at a time, with the “title” statement omitted and the after “chainloader +1” add one more statement of “boot”.

    As an example if a user in a Grub prompt can boot the second partition manually by
    Code:
    hide (hd3,0)
    unhide (hd3,1)
    root (hd3,1)
    chainloader +1
    boot
    He/she can fire up a hard disk any time in a Grub prompt by loading its MBR by
    Code:
    root (hd0)
    chainloader +1
    boot
    It is noteworthy to point out the simple process of booting here too. What Grub is doing here after being informed of the partition required to be booted by the “root” statement it is then instructed to chainload the boot sector of the partition at the “+1” position, meaning from the second sector onward as Grub itself occupies the first sector.

    If a user has no floppy drive then it will be necessary to install Grub in the pen drive. A different thread has be written for this particular purpose. It is a cunning technique because the pen drive has 4 primary partitions and has no more room for Grub which needs a partition for installation. Grub cannot be place in a NTFS partition because it cannot read such filing system. However a newer version Grub2 may be able to read a NTFS partition but it may need the partition's boot sector for residence too. Please refer to this thread for details to place Grub in a fully populated flash drive. I have written this thread showing how Grub can be put inside a CD/DVD or a hard disk partition.

    Discussuion of results


    The 4 Vista and Win7 installation DVDs were successfully transferred and booted up as expected. However I found the MS installer has been written to fetch files from the first partition from the flash drive. Therefore partitions in front of the one you want to boot must be temporarily deleted. If this rule is not followed the installer can report an error asking a driver for the CD/DVD drive.

    All 4 installation DVDs have been booted successfully and can be used for installation.

    Example of deleting partitions in front of the one required to be booted.

    I deleted the first primary and booted the second partition which is still known to Linux as sdc2 but the partition table now has no sdc1 entry. To my surprise my Win7-32 booted. I then deleted the second partition and the 3rd partition of Vista-64 booted up successfully. With the partition table looking like this
    Code:
    Disk /dev/sdb: 16.2 GB, 16173236224 bytes
    255 heads, 63 sectors/track, 1966 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00017ff8
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc3             787        1440     5253255    7  HPFS/NTFS
    /dev/sdc4            1441        1963     4200997+   7  HPFS/NTFS
    Naturally I tried the last partition sdc4 by removing sdc3 and my Win7-64 fired up. So it all works as long as the Installation DVD is at the "first" partition of the hard disk with nothing ahead of it.

    It is a bit of inconvenient I admit but remember I could restore my partition table any time with a script. So I went into the Internet, displayed this thread, copied the script in Section (C), activated it in a terminal and did
    Code:
    sfdisk /dev/sdc <a2
    and have my full partition table back again.

    In conclusion the above scheme can allow all 4 Vista/Win7 installation DVD installable from 4 primary partition of a flash drive. More can be accommodated if they are stored in the logical partitions. (see Post #5). However putting the installers in the primary partitions seems better and has less hassel with the installer during the boot time.


    Conclusions

    The simple booting of Vista/Win7 installer by a Linux boot loader Grub is demonstrated.

    Grub in here has been made to interface with the Vista/Win7 boot loader bootmgr. The two work seamlessly.

    Grub's ability to boot an operating system step by step manually is highlighted.

    I was talked into working with a flash drive. Many restrictions disappear if a USB external hard disk is used.
    Last edited by saikee; 06-22-2010 at 05:23 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  2. #2
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,961

    Additional tips and explanations

    Tips for Windows Users

    In the Scheme proposed in Post #1 a USB hard disk was temporarily used for the storage of the DVDs. The contents was finally transferred to the flash drive. This is because MS Windows do not treat a USB hard disk as a "Super floppy" with only one partition but a flash drive they do. Therefore with a USB hard disk a user can operate all 4 primary partition simultaneously and save a lot of time.

    Therefore Step (i), (ii) and (iii) can all be done in a pure MS Windows environment.

    Step (i) can be carried out in MS Windows using "disk Management". The creation of a partition is coupled with formatting in Windows. In Linux the two must be separated if it is done in a terminal but in a desktop programs like Gparted will carry out the two task simultaneously just like Windows.

    Step (2) Can be done in Windows "drag and drop" or in a Command Prompt with command like "xcopy" from one drive to another.

    Step (3) Must be done in a Windows environment and it has to be a 64-bit too because a 32-bit Windows cannot load the bootsect.exe of a 64-bit Windows installer. I have not investigated further but it would appear there may be a reason for it so to play safe carry out the operation of "bootsect.exe" a a 64-bit environment which is obtainable by booting up a Vista-64 or Win7-64 installation DVD and opt for the Command Prompt.

    The Vista/Win7 have another command to fix the boot sector like
    Code:
    bootrec.exe /fixboot
    but this command may be suitable for the C: drive only. I used bootsect.exe because it can be done for all partitions at the same time.

    Both Vista and Win7 use the same boot loader boot.mgr but the newer version in the Win7 should be better and downward compatible. Use it whenever possible.

    The transfer of the contents from a USB hard disk to a USB flash drive can also be done by Windows third party special software like Norton Ghost or Acronis but I have not tried it myself. I use Linux because "dd" is a fundamental tool and is normally the fastest if you know exactly what you want.

    The booting process has been made complicated by my write up, mainly my detailed step to obtain a Grub floppy which is the most useful booting tool ever invented. It can be used to boot up any installed operating system in a PC. If you have it then you can boot the flash drive immediately after executing the bootsect command.

    In fact if you are interested in the subject you can only do the bootsect on one of the partitions, say the 3rd one, and use the GRub floppy to try all 4 primary partition to prove only the 3rd one will respond. Grub will tell you by an error message that other partitions are not bootable.

    I put in a bit of effort to explain how Grub works. The simple commands "root (hdx,y)", "chainloader +1" and "boot" are universal to all installed MS systems from Dos to Win7. All you need is a Grub floppy and the disk number in x and the partition number in y. Booting with Grub in a "child play".

    I hope this thread will go some way to convince the readers that the booting process is a lot simpler than M$ wants us to believe.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  3. #3
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,961
    Tips for Linux Users

    Grub2 can equally be used to carry out the booting.

    Many Internet sites have advices on how to make a Grub2 floppy and I have listed one as Task K1 in Just booting tips under my signature. Similarly for making a Grub2 CD please see Task K2.

    To boot say second partition of the 4th disk and hide the first one with Grub2 commands at a Grub prompt is simply
    Code:
    parttool (hd3,1) hidden+
    parttool (hd3,2) hidden-
    set root=(hd3,2)
    chainloader +1
    boot
    Grub2 count the disk from zero same as Grub1 but for partition Grub1 now counts from 1. Therefore (hd3,1) to Grub1 is equivalent (hd3,2) to Grub2.

    In case of doubt use geometry in Grub1 to check the partitions
    Code:
    geometry (hd3)
    The equivalent in Grub2 is
    Code:
    ls (hd3,2)/
    which can be used to list the internal directory of / of (hd3,2)
    Last edited by saikee; 06-17-2010 at 04:21 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  4. #4
    Join Date
    Sep 2003
    Location
    Knoxville, TN
    Posts
    123
    All I can say is, keep the tutorials coming, they're always great!
    You are most definitely the grub guru.

  5. #5
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,961
    Upated on 18/6/2010

    I now have discovered all 4 the MS Windows installation DVD can be booted from logical partitions. In Linux partition number 5 and above are logical partitions.

    This opens a huge door to pack as many MS Windows installer DVDs into a flash drive. In Linux at least 15 partitions is fully supported by every distro. Actually after libATA has been adopted for detection of hard disks after kernel 2.6.28 there is no limit set on the number of partitions in a hard disk.

    MS installers do not expect more than one partition in a flash drive so if an installer is in the 6th partition then it will be necessary to delete the partitions before it so that the MS installer can locate it. The removal of the partitions is only temporary and the data inside the partitions are not affected as I have indicated in the Post #1. The deleted partitions will be reinstated if the original partition table is rebuilt with the exact boundaries as before.

    To keep a record of the original partition table I wrote a script for the partitioning of the disk. Whenever I need the original partition table I simply re-partition the disk with the script again.

    This is the script which generate a text file a2
    Code:
    echo ",1950,E">a2;echo ",1,L">>a2;echo ",1,L">>a2;echo ",1,L">>a2;echo ",390,7">>a2;echo ",390,7">>a2;echo ",650,7">>a2;echo ",520,7">>a2
    The content of a2 is quite simple as (italic text is explanation)
    Code:
    ,1950,E -----first partition starts at default position (0) and has a size 1950 cylinders as an extended partition
    ,1,L  ----- A unused partition No 2 of only 1 cylinder large for Linux
    ,1,L  ----- A unused partition No 3 of only 1 cylinder large for Linux
    ,1,L  ----- A unused partition No 4 of only 1 cylinder large for Linux
    ,390,7 --- Since primary partitions have been exhausted so this is the 1st logical partition sdc5 - for Vista-32
    ,390,7 ---- Second logical partition sdc6, 390 cylinders, type 7 for NTFS to store Win7-32
    ,650,7 ---- Third logical partition sdc7, 650 cylinders, type 7 for NTFS to store Vista-64
    ,520,7 ---- Fourth logical partition sdc8 520 cylinders, type 7 for NTFS to store Win7-64
    The choices of 390, 390, 650 and 520 cylinders are to match the 4 installation DVD contents of having the sizes of 2.56Gb, 2.41Gb, 3.74Gb and 3.06Gb approximately so that all of them fit into the 16Gb flash drive with only 1966 cylinders.
    The above script is submitted to work with the partitioning tool "sfdisk" by command
    Code:
    sfdisk /dev/sdc < a2
    In Linux the logical partitions always starts at the 5th position as the first 4 are reserved primaries regardless even if not all of them are used. The above command produces this partition table
    Code:
    Disk /dev/sdc: 16.1 GB, 16173236224 bytes
    255 heads, 63 sectors/track, 1966 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x69205244
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1        1950    15663374+   5  Extended
    /dev/sdc2            1951        1951        8032+  83  Linux
    /dev/sdc3            1952        1952        8032+  83  Linux
    /dev/sdc4            1953        1953        8032+  83  Linux
    /dev/sdc5               1         390     3132674    7  HPFS/NTFS
    /dev/sdc6             391         780     3132674+   7  HPFS/NTFS
    /dev/sdc7             781        1430     5221124+   7  HPFS/NTFS
    /dev/sdc8            1431        1950     4176899+   7  HPFS/NTFS
    I needed the sdc2, sdc3 and sdc4 temporarily for creation of the partition table and can delete them by fdisk using this command
    Code:
    fdisk /dev/sdc << eof
    > d
    > 2
    > d
    > 3
    > d
    > 4
    > w
    > eof
    The partition table after deletion of sdc2 to sdc5 shows up as
    Code:
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1        1950    15663374+   5  Extended
    /dev/sdc5               1         390     3132674    7  HPFS/NTFS
    /dev/sdc6             391         780     3132674+   7  HPFS/NTFS
    /dev/sdc7             781        1430     5221124+   7  HPFS/NTFS
    /dev/sdc8            1431        1950     4176899+   7  HPFS/NTFS

    Logical partition must be in a continuous chain with the sdc5 carries the hard disk address of sdc6 and so on. Thus if sdc5 is deleted the old sdc6 will have to shift up to become the new sdc5. Every partition afterward does the same as shown
    Code:
    root@saikee-desktop:/home/saikee# fdisk /dev/sdc << eof
    > d
    > 5
    > w
    > eof
    root@saikee-desktop:/home/saikee# fdisk -l /dev/sdc
    
    Disk /dev/sdc: 16.1 GB, 16173236224 bytes
    255 heads, 63 sectors/track, 1966 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x69205244
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1        1950    15663374+   5  Extended
    /dev/sdc5             391         780     3132674+   7  HPFS/NTFS
    /dev/sdc6             781        1430     5221124+   7  HPFS/NTFS
    /dev/sdc7            1431        1950     4176899+   7  HPFS/NTFS
    .
    Therefore all I need to do is copy the contents of Vista-32, Win7-32, Vista-64 and Win7-64 installation DVDs into partitions sdc5, sdc6, sdc7 and sdc8 respectively. Make each bootable by executing the bootsect.exe as described previously. The system I could boot immediately is the sdc5 which is Vista-32.

    If I want to boot up Win7-64 then I need to delete sdc7, sdc6 and sdc5 using a script
    Code:
    root@saikee-desktop:/home/saikee# fdisk /dev/sdc << eof
    > d
    > 7
    > d
    > 6
    > d
    > 5
    > w
    > eof
    root@saikee-desktop:/home/saikee# fdisk -l /dev/sdc
    
    Disk /dev/sdc: 16.1 GB, 16173236224 bytes
    255 heads, 63 sectors/track, 1966 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x69205244
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1        1950    15663374+   5  Extended
    /dev/sdc5            1431        1950     4176899+   7  HPFS/NTFS
    Thus the system I want to boot is always the first partition from the partition table. sdc1 is an extended partition describing the border from old sdc5 to the old sdc8 and cannot be mounted. It is important to appreciate the cuurent sdc5 is the old sdc8 I started with because that is how a Msdos partition table behaves.

    I can get back my full partition table at any time by command
    Code:
    sfdisk /dev/sdc < a2
    As I always boot sdc5 so my commands with Grub is fixed as
    Code:
    root (hd2,4)
    chainloader +1 boot
    The above is the technique I used to boot 4 Vista and Win7 installation DVDs stored in a flash drive. It should be understood that I was only playing with the partition table all the time. Not one byte has been altered inside the four partitions of sdc5, sdc6 sdc7 and sdc8. Since I created the partitions by a script a2 I am pretty safe knowing the exact copy of the partition table can be re-generated at any time.


    Just another pointer on gpt partitioning scheme.

    I have tried to use gpt partitions in the flash drive. This works perfectly in Linux and I was able to copy all the MS installation DVD onto it.

    Just as I expected Vista and Win7 support gpt so they can mount the partition. However they get confirmation from the controller that the flash drive is a movable disk. As a consequence only the first partition could be mounted.

    I was able to write the boot sector code on the gpt partition using the "bootsect.exe" command and everything seemed to work until I tried to boot up the gpt partition. The installer reported "Error 0xc0000225".

    After trying a second time I came to the conclusion the Vista and Win7 installers are not bootable from a gpt flash drive. According to M$ web site MS systems do not even accept gpt on a movable disk.

    So don't waste time to put Vista/Win7 installation DVD on a flash drive partitioned with a Gpt scheme as they don't boot.

    They boot alright if the flash drive has the normal Msdos partitions.
    Last edited by saikee; 06-20-2010 at 05:53 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

Posting Permissions

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