Pages

Monday, 18 February 2013

GRUB Embedded Menu

To summarise,
(cd) and (fd) devices are not scanned for either grldr or menu.lst, unless they are the boot device.

If grldr is loaded from a (hd) device via Grub4dos code in the MBR or partition boot sector, then the partition from which it is loaded becomes the root device. This partition is scanned for menu.lst at the root of the partition and in the directories /boot/grub/ and /grub/. If menu.lst is not found in any of these locations then all supported hard disks and partitions are scanned for menu.lst (at root and in /boot/grub/ and /grub/ directories) - (cd) and (fd) devices are not searched. If menu.lst is not found then the device from which grldr was loaded remains the root device. If menu.lst is found then the partition from which it was loaded becomes the root device. menu.lst does not therefore have to be contained in the same partition as grldr.

If grldr is loaded from a (cd) device then (cd) becomes root. (cd) is then scanned for menu.lst (at root and in /boot/grub/ and /grub/ directories). If menu.lst is not present in these location then (hd) devices are scanned (at root and in /boot/grub/ and /grub/ directories) - (fd) devices are not searched. If menu.lst is found on a (hd) device then the partition from which it was loaded becomes the root device.

If grldr is loaded from a (fd) device then (fd) becomes root. (fd) is then scanned for menu.lst (at root and in /boot/grub/ and /grub/ directories). If menu.lst is not present in these location then (hd) devices are scanned (at root and in /boot/grub/ and /grub/ directories) - (cd) devices are not searched. If menu.lst is found on a (hd) device then the partition from which it was loaded becomes the root device.

A note from README_GRUB4DOS.txt if loading grldr via ntldr (the NT loader used by Windows NT/2000/XP) - "...ntldr only loads the startup code of grldr (i.e., the leading 16 sectors of grldr), not the whole grldr file". The embedding settings in the startup code consequently scans for grldr in all supported (hd) type devices. If grldr is present on more than one partition then another instance of grldr could be loaded. If for example grldr (the first 16 sectors) was initially loaded from (hd0,3) but grldr was also present on (hd0,0), then (hd0,0)/grldr would be loaded and (hd0,0) would become root.

If menu.lst is not present on the device from which grldr was loaded but multiple menu.lst files are present on other devices (e.g. on (hd0,0) and (hd1,2)) then the first instance of menu.lst is loaded - in this case (hd0,0).

Sunday, 17 February 2013

Renaming grldr


 http://diddy.boot-land.net/grub4dos/Grub4dos.htm

If loading grldr via the Windows NT/2000/XP loader (ntldr), changing the grldr filename will result in Grub4dos failing to boot. Note from README_GRUB4DOS.txt - "...ntldr only loads the startup code of grldr (i.e., the leading 16 sectors of grldr), not the whole grldr file". The embedding settings in the startup code consequently scans for grldr in all available drives - if the file was renamed it will no longer be found. The following test was carried out on a dual boot system containing Windows Vista on (hd0,0) and Windows XP on (hd0,1). (hd0,1) was set as the active partition and mygrldr (renamed grldr) was loaded via C:\mygrldr="Grub4Dos" entry in boot.ini. This resulted in the following output -
Try (hd0,0): NTFS5: No grldr
Try (hd0,1): NTFS5: No grldr
Try (hd0,3): invalid or null
Try (hd0,4): invalid or null
Try (fd0): invalid or null
Error: Cannot find grldr in all drives. Press Ctrl+Alt+Del to restart._
It is possible to change the embedded setting to search for a different file by using the grubinst/grubutil tool. The procedure is outlined in README_GRUB4DOS.txt -
  • Download the latest version of grubinst/grubutil (see here).
  • Copy grldr to C:\ drive and rename as C:\mygrldr
  • Open a command prompt and run the command grubinst -o -b=mygrldr C:\grldr.mbr - where -b=mygrldr will replace the embedded reference to grldr with mygrldr in the created file C:\grldr.mbr. Note - you can use any name for the file C:\grldr.mbr, however make sure you use the 8.3 naming convention.
  • Now load C:\grldr.mbr from Windows NT/2K/XP by adding C:\grldr.mbr="Grub4Dos" to your boot.ini file.
Alternatively, grubinst/grubutil can be used to edit an existing grldr and/or grldr.mbr file. This will require a compatible version of grubinst.
  • Copy grldr.mbr to C:\ drive and rename this file if required (making sure that you use the 8.3 naming convention). Run the command grubinst -e -b=mygrldr C:\grldr.mbr to replace the embedded reference to grldr with mygrldr. Now add entry C:\grldr.mbr="Grub4Dos" to boot.ini
  • Alternatively, copy grldr to C:\ drive and rename the file to mygrldr. Run the command grubinst -e -b=mygrldr C:\mygrldr to replace the embedded reference to grldr with mygrldr. Now add entry C:\mygrldr="Grub4Dos" in boot.ini
Unfortunately, at the time of testing, the latest version of grubinst (grubinst-1.1-bin-w32-2008-01-01) is not compatible with Grub4dos build 2009-02-05. Running command grubinst -e -b=mygrldr C:\grldr.mbr results in grubinst: Invalid input file error and grubinst -e -b=mygrldr C:\grldr results in grubinst: Version number mismatched (old=4 new=2) error.

Friday, 15 February 2013

Defragmenting boot files under Win7

Rundll32.exe advapi32.dll,ProcessIdleTasks
defrag -b %SystemDrive%
 
save it as batch file and select run as administrator
If you choose to create your own file, DO NOT NAME IT DEFRAG.BAT! 
If you do it will cause the batch file to loop over and over! 

Convert to NTFS

To convert a FAT partition to NTFS, perform the following steps.
  1. Click Start, click Programs, and then click Command Prompt.
  2. At the command prompt, type CONVERT [driveletter]: /FS:NTFS.
  3. Convert.exe will attempt to convert the partition to NTFS.

Disk Defragment Tips


Tips and tricks

  • Many users start looking for defragmentation/optimization programs when their computer becomes slow. The main reason for a slow computer is a full harddisk. A full harddisk is slow because the distance between files is greater than on a fresh practically empty harddisk. Deleting half the data on a full disk will just about double the speed. The more free diskspace, the faster your computer will be.
  • Buy a second harddisk (for example an USB harddisk) and move little used stuff from your primary harddisk to that secondary harddisk. The second disk can also be used for backing up the primary disk.
  • The first partition on a harddisk (usually the C: partition) is significantly faster than other partitions. Place your important programs on this first partition and try to use other partitions only for data that is used less often (such as music, movies, archives, backups, logfiles). From a speed perspective it is best to have only a single partition.
  • When buying a new computer, buy the biggest harddisk you can afford. Investing in a bigger harddisk gives more speed-per-dollar than investing in a faster CPU or investing in more memory. The same amount of data on a bigger harddisk is faster because the data takes up less physical space, so the harddisk heads have to travel less distance.
  • Cleanup old junk from your harddisk before running MyDefrag. You can clean Windows files with for example "Start -> Programs -> Accessories -> System Tools -> Disk Cleanup", or with something like the freeware  *  CCleaner program.
  • Reboot before running MyDefrag. This will release files that are in use, so they can be defragmented and optimized.
  • Boot into Windows safe mode by pressing F8 when booting, and then run MyDefrag. It will be slower because the Windows disk cache is off in safe mode, but MyDefrag will be able to process (a few) more files.
  • Stop your real time virus scanner before running MyDefrag. Some virus scanners check all disk activity, making defragmentation and optimization very slow.
  • Move the swap file to another volume, reboot, defragment, and move the swap file back. If you don't have a second volume then temporarily make the swap file small, for example 100Mb.
  • Package unused files with a packager such as  *  7-zip. The packagefile not only takes less harddisk space, but will also defragment and optimize much faster than the individual files. Note: This does not apply to Windows NTFS compression, which will actually make defragmentation and optimization slower.
  • If you have 2 physical harddisks of the same speed, then place the pagefile on the first partition of the second harddisk. 

Source: http://www.mydefrag.com/Manual-TipsAndTricks.html

Tuesday, 12 February 2013

PE 3.0 to USB

1. Install and configure PStart

 When the installation wizard of PStart asks you about the setup type, you should choose Portable Setup. Select your USB drive and tell the wizard to copy PStart to the root folder. Next, you can launch PStart from your USB drive with Windows Explorer.

2. Launch PStart automatically when WinPE boots up

mkdir c:\img
imagex /mountrw F:\sources\boot.wim 1 c:\img
 

c:\img\windows\system32\startnet.cmd

Add these lines to startnet.cmd after the wpeinit command 

@echo off
for %%p in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\PStart\ set w=%%p
%w%:\PStart\PStart.exe
 

And commit changes to wim

imagex /unmount /commit c:\img

3. Add your own rescue tools

 

Monday, 11 February 2013

Understand Bcdedit

Procedure to understand bcdedit

you have to first create a store(BCD).
Add bootmgr entry.

if you are not mounting anything just specify device and boot to file path.
if you are mounting .wim or .vhd (remember guid) you have to also specify osdevice and its system root folder.

Sunday, 10 February 2013

BCDedit


Examples - Part 1


The BCD Store used to boot the operating system may be in use as the system store - if a system store is in use then this will be the default store on which all bcdedit commands are carried out. If no system store is in use, or to specify a store other than the system store, the /store switch must be used.
I personally recommend using the /store switch whenever modifying a BCD store to reduce the risk of targeting the wrong store. To specify the BCD store D:\Boot\BCD we would use the command bcdedit.exe /store D:\Boot\BCD .....
Before modifying a BCD store I recommend that you create a backup. Be aware that modifying a BCD store could result in your system not booting, I therefore recommend that you take either of the following precautions -
  • Create a BOOTMGR bootable CD/DVD/USB/Floppy with your existing (working) BCD store copied to it. BCD entries (with the exception of any devices set as BOOT) contain disk signature and partition offset information - booting the BCD store from another device will therefore still target the correct device.
  • Create a WinPE bootable CD/DVD/USB disk and use this to replace a non-working BCD store with the backup you made earlier. If you do not have access to WinPE then many Linux Live distributions can also be used.

Administrator Account on Windows 7

First you’ll need to open a command prompt in administrator mode by right-clicking and choosing “Run as administrator” (or use the Ctrl+Shift+Enter shortcut from the search box)

 Enable Built-in Administrator Account
net user administrator /active:yes
 Disable Built-in Administrator Account
net user administrator /active:no

Sunday, 24 June 2012

Fun Facts


Astronomy
Earth is the only planet not named after a pagan god.
Venus is the only planet that rotates clockwise.

Image Hosted by ImageShack.us

Biology

1.
Animals

A cockroach will live nine days without its head before it starves to death.
The cockroach has a high resistance to radiation and is the creature most likely to survive a nuclear war.
The male praying mantis cannot copulate while its head is attached to its body. The female initiates sex by ripping the male's head off.
Elephants are the only animals that cannot jump.
A pig's orgasm lasts 30 minutes.
Humans and dolphins are the only species that have sex for pleasure.
Some lions mate over 50 times a day.

The catfish has over 27,000 taste buds.
Starfish have no brains.
A goldfish has a memory span of 3 seconds.
The giraffe has the highest blood pressure of any animal.
Zebras can't see the color orange.
An elephant can be pregnant for up to 2 years.
Mosquitoes have 47 teeth.
A group of kangaroos is called a mob.
The Poison Arrow frog has enough poison to kill 2,200 people.


11. General


111. Humans
The strongest muscle in the human body is the tongue.
Babies are born without kneecaps. They appear when the child is 2-6 years of age.
Your body is creating and killing 15 million red blood cells per second!
The most sensitive finger on the human hand is the index finger.
The hardest bone in the human body is the jawbone.
Hair is the fastest growing tissue in the body, second only to bone marrow.
There are 35 million digestive glands in the stomach.

Image Hosted by ImageShack.us

Chemistry
Image Hosted by ImageShack.us

Companies
Google receives about 200 million search queries each day.The first owner of the Marlboro company died of lung cancer.
Image Hosted by ImageShack.us

Countries
Russia has the most movie theaters in the world.
Canada is an Indian word meaning "Big Village"
Seoul, the South Korean capital, just means "the capital" in the Korean language
Image Hosted by ImageShack.us


Did you know stuff

Pearls melt in vinegar.
A quarter has 119 grooves around the edge.
A dime has 118 ridges around the edge.
Because of Animal Crackers, many kids until they reach the age of ten, believe a bear is as tall as a giraffe.
The Eiffel Tower has 1792 steps.
It is said that sucking on a copper penny will cause a breathalyzer to read 0.
America once issued a 5-cent bill.
Each king in a deck of playing cards represents a great king from history. Spades--King David, Clubs--Alexander the Great, Hearts--Charlemagne and Diamonds--Julius Caesar.
If a statue in the park of a person on a horse has both front legs in the air, the person died in battle; if the horse has one leg front leg in the air, the person died as a result of wounds received in battle; if the horse has all 4 legs on the ground, the person died of natural causes.
Image Hosted by ImageShack.us

Food & Beverages
Honey is the only food that does not spoil. Honey found in the tombs of Egyptian pharaohs has been tasted by archaeologists and found edible.
The avocado has the most calories of any fruit.
Image Hosted by ImageShack.us

Funny Stuff
Guinness Book Of Records holds the record for being the book most stolen from Public Libraries.
Donald Duck comics were banned in Finland because he didn't wear pants.
In the 40's, the Bich pen was changed to Bic for fear that Americans would pronounce it 'Bitch.'
Mafia in Old Arabic means 'sanctuary'.

Image Hosted by ImageShack.us

General Science
If you can see a rainbow you must have your back to the sun.

Image Hosted by ImageShack.us

Geography
Image Hosted by ImageShack.us

History
Because metal was scarce, the Oscars given out during World War II were made out of wood.
Image Hosted by ImageShack.us


Inventions
The doorbell was invented in 1831.
George Washington Carver invented peanut butter.
Toilet paper was invented in 1857.
Dry cereal for breakfast was invented by John Henry Kellogg.
Image Hosted by ImageShack.us

Language
China has more English speaking people than the United States
There are only four words in the English language which end in '-dous':tremendous, horrendous, stupendous, and hazardous .
There are only 12 letters in the Hawaiian alphabet.
The ship, the Queen Elizabeth 2, should always be written as QE2. QEII is the actual queen.

Image Hosted by ImageShack.us

Mathematics

Image Hosted by ImageShack.us

Miscellaneous
Most dust particles in your house are made from dead skin.
If you ate too many carrots you would turn orange.
The colder the room you sleep in, the better the chances are that you'll have a bad dream.
No piece of paper can be folded more than 7 times.
The US national anthem actually has three verses, but everyone just knows the first one.
The term Cop comes from Constable on Patrol, which is a term used in England.

Image Hosted by ImageShack.us

People
Intelligent people have more zinc and copper in their hair.The world's youngest parents were 8 and 9 and lived in China in 1910.
Whoopi Goldberg was a mortuary cosmetologist and a bricklayer before becoming an actress.

Image Hosted by ImageShack.us

Physics
Image Hosted by ImageShack.us

Politics
Image Hosted by ImageShack.us

Religion

The youngest Pope was 11 years old.
Papaphobia is the fear of Popes
Image Hosted by ImageShack.us

Technology
More steel in the US is used to make bottle caps than to manufacture automobile bodies.
Image Hosted by ImageShack.us