Skip to main content

bootable USB drive

What makes a USB drive bootable?

When I was searching for the process of making my pendrive bootable. I came across many processes and software’s that could do it but none of the sources told me what is the science behind this. Why my pen drive is bootable after the process and was not before. So I decided to write an article of my own for this.
This is also my first post. So please do comment what you dislike and also like about the post and also if you need any help.
The process of making a pendrive bootable and to use it with window 7 and other window operating systems the process that was described by the sources was
1. Open command prompt(cmd) with administrator privileges
2. Type DISKPART
3. Type LIST DISK
4. Then assuming your USB disk is DISK1. Type SELECT DISK 1
5. Type CLEAN
6. Type CREATE PARTITION PRIMARY
7. Type SELECT PARTITION 1
8. Type ACTIVE
9. Type FORMAT FS = NTFS
10. Type ASSIGN
11. Type EXIT
12. Insert window installation disk
13. In the command prompt window type D: CD BOOT(assuming your cd/dvd drive is labelled D)
14. Type BOOTSECT.EXE /NT60 H: (assuming your USB drive is labelled H)
15. Copy all the contents of the windows installation disk into the USB drive
Let’s start with

DISKPART
DISKPART enables a superset of the actions that are supported by the Disk Management snap-in. The Disk Management snap-in prohibits you from inadvertently performing actions that may result in data loss. It is recommended that you use the DISKPART utility cautiously because DISKPART enables explicit control of partitions and volumes.
DISKPART can perform various functions like
1. converting a basic disk to dynamic disk
2. converting a dynamic disk to basic disk
3. DISKPART can create a partition at an explicit disk offset
4. DISKPART can be used to delete missing dynamic disks
DISKPART commands operate on a specific target disk, partition, or volume. The targeted object has "focus." Focus simplifies the common configuration task in which you create multiple partitions on the same disk. An object is put into focus by the select command. All Commands except for list, help, rem, exit, or help require focus.

LIST DISK
LIST DISK is a command in the bigger DISKPART utility. LIST DISK is used to retrieve a summary of information about each disk in the computer. Only fixed disks (for example, integrated device electronics [IDE] or small computer system interface [SCSI]) or removable disk (for example, 1394 or USB) are listed. The removable drives are not displayed. The disk with the * asterisk has current focus.

SELECT DISK
Select disk command is used to select a particular disk out of the list that was presented by the LIST DISK command.
SELECT DISK[= n]

CLEAN
CLEAN command is used to delete all the partitions from the current in focus disk. Now because the partition information in the most used partition resides in the first sector of the disk clean command deletes that information by zeroing it and thereby deletes all the partition information from the drive.
CLEAN ALL command zeroes all the sectors on the drive in focus thereby deleting all the data.

CREATE PARTITION PRIMARY
This command creates a primary partition in the disk in focus.
A primary partition contains one file system. In MS-DOS and earlier versions of Microsoft Windows systems, the first partition (C:) must be a primary partition. Some operating systems are not limited in this way; however, this can depend on other factors, such as a PC's BIOS.
The partition type code for a primary partition can either correspond to a file system contained within (e.g. 0x07 means either an NTFS or an OS/2 HPFS file system) or indicate the partition has a special use (e.g. code 0x82 usually indicates a Linux swap partition). The FAT16 and FAT32 file systems have made use of quite a number of partition type codes over time due to the limits of various DOS and Windows OS versions. Though a Linux operating system may recognize a number of different file systems (ext2, ext3, ReiserFS, etc.), they have all consistently used the same partition type code: 0x83 (Linux native file system).

SELECT PARTITION 1
This command selects the first partition from the drive in focus. Because earlier we deleted all the partition and then we made a brand new partition on the drive this partition will be the one that we created recently.

ACTIVE
This command tell the firmware that this particular partition of the drive is ‘active’ or bootable

FORMAT FS = NTFS
As the name suggests this command formats the drive in focus and deletes all the data in the drive plus changes the file system to NTFS. This is needed to make the drive bootable. NTFS as it is has many advantages over fat formats like quota and security.

ASSIGN
This command is used to assign a drive letter or the mount point to the partition in focus. If no drive letter is mentioned as in our case the next free drive letter is assigned to the partition.

EXIT
This obviously exits the Diskpart utility.

BOOTSECT
Bootsect.exe updates the master boot code for hard disk partitions to switch between BOOTMGR and NTLDR. You can use this tool to restore the boot sector on your computer. This tool replaces FixFAT and FixNTFS.
Bootmgr is used in window vista and window 7 only and NTLDR was used in window xp and earlier versions to load the operating system while booting.
Bootsect can also solve your problem of dual boot when 2 operating systems are used one that uses NTLDR and other that uses BOOTMGR.

Comments

Popular posts from this blog

Dynaminism in .Net 4.0

few dayz ago came across THIS question. the solution to this can easily be figured out by the new dynamic features introduced in .Net 4.0. i have made a project to demonstrate this. the main code in the project goes like this public   static   dynamic [] GetDynamicObject( DataTable  dt,  Dictionary < string ,  string > mapping)         {              List < dynamic > returnList =  new   List < dynamic >();              foreach  ( DataRow  row  in  dt.Rows)             {                  dynamic  obj =  new   ExpandoObject ();                  var  objectDic = ( IDictionary < string ,  object >)obj;                  foreach  ( DataColumn  column  in  dt.Columns)                 {                     objectDic.Add(mapping!= null ?mapping.ContainsKey(column.ColumnName) ? mapping[column.ColumnName] : column.ColumnName:column.ColumnName,row[column]);                 }                 returnList.Add(obj);             }              return  returnLis

ParameterLess construct

When I was creating my first cloud app that’s used Microsoft Azure for storage and computation purposes I came across a strange problem which wasn’t related to the Azure itself but was more related to the c# and the .net framework. When I was writing the code I made a Class which had no parameter less construct. Objects of this class were then used in the program. Because this class was derived from Ienumerator I could actually user Foreach() on the objects of this class but to my surprise the code shown below was showing error at the highlighted line. using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.WindowsAzure.StorageClient; using Microsoft.WindowsAzure; namespace WebRole1 { public class mspDataServiceContext : TableServiceContext { public mspDataServiceContext(string baseAddress, StorageCredentials credentials) : base(baseAddress, credentials) { } static int c; public IQueryable<msp> msps { get { retur

Data manipulation in azure development storage by using web services – workaround

While developing the Azure project this was the biggest problem I came across and being just a newcomer in this area I could not solve it. So I figured a way around that worked perfectly well and then I used it to finally make a working project. Nearly all the solutions I came across in the different portals were about the same problem without the development storage anywhere in question but for the people who first need to make a working solution in the development storage using anything like the VS2010 there was no help nowhere. The problem was that while accessing data which was stored in a blob in cloud storage through a web service by a Silverlight client. It gives an impression to the storage of the cloud that this is being done by cross site scripting (this is what I got from all the different sources I read) and because this was not allowed the cloud project (webrole in my case) was blocking the request and was returning nothing in return. So this solution that I figured out i