Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Tuesday, January 3, 2012

Making a bootable pendrive of Windows 7 using Linux

Creating a bootable USB drive of Windows 7 (or even Vista or XP) in Linux the non-nerdy way. So this doesn't involve using the dd command anywhere.

The steps involved are :

  1. Get the required Windows OS iso image. I shall use the Windows 7 example.
  2. Format your USB drive to NTFS. Use Disk Utility in Ubuntu to do it or any other way you prefer.
  3. Mount the image, use the following set of commands to mount the iso image.

    Code:
    $ su -
    # mkdir -p /mnt/disk
    # mount -o loop disk1.iso /mnt/disk
    # cd /mnt/disk
    # ls -l
  4. Copy everything present in the /mnt/disk directory to your formatted USB drive.
  5. You now need to manually install the Windows MBR into your USB drive. To do this, install this very handy tool called ms-sys

    Install it :
    Code:
    tar xvf ms-sys-2.1.5.tar.gz
    cd ms-sys
    make
    make install #as root
    Write a Windows 7 MBR to your USB drive (as root)

    Use the "ms-sys -h" command for other the right option for other Windows Operating Systems
    Code:
    ms-sys -7 /dev/sdX
    Replace 'X' with your USB drive letter, its usally 'b' so its /dev/sdb.

    Once you are done, you have a Windows 7 Bootable USB drive.
If you are stuck anywhere, or encounter any problem please do ping us or leave a comment and we will get back to you as soon as possible.

Saturday, July 16, 2011

saving grub from windows

lost your grub after installing windows? here is a simple way of getting it back.

[note: assuming windows being installed on top of ubuntu(using grub2) ]

1: boot from a live cd and open a terminal

2: sudo fdisk -l

this will show the partitioin table. Here is my partition table

Device Boot   Start         End              Blocks    Id  System

/dev/sda1                   63        771119      385528+   de  Dell Utility

/dev/sda2   *        772096   105629695    52428800   83  Linux

/dev/sda4       105631722   625141759   259755019    f   W95 Ext’d (LBA)

/dev/sda5       105631744   315355949   104862103    7  HPFS/NTFS

/dev/sda6       315356013   561134384   122889186    7  HPFS/NTFS

/dev/sda7       621142016   625141759      1999872   82   Linux swap / Solaris

/dev/sda8       561134448   621137159    30001356    83   Linux

3: mount the linux partition on which you want install the grub (sda8 in my case)

$sudo mount /dev/sda8 /mnt/

$sudo mount - -bind /dev /mnt/dev

$sudo mount - -bind /proc /mnt/proc

4: Now chroot into this environment

sudo chroot /mnt

[optional]if you want to change any default setting like timeout options… then look at /etc/default/grub

5: #grub-install /dev/sda

[ in case of error do #grub-install - -recheck /dev/sda ]

6: now unmount and reboot the system.

#exit

$sudo umount /mnt/dev

$sudo umount /mnt/proc

$sudo umount /mnt

$sudo reboot