Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, August 09, 2007

Why Linux cries about "1024 cylinders thing" at the time of installation...

I have been installing Linux for last 6 years and for more than half the number of times, came across a message something like "This partitions is beyond the 1024 cylinder boundary and may not be bootable". But never cared for it much and understood what exactly it meant to say ?

Yesterday I was reading System Admin guide to Linux by Lars Wirzenius (Thanks Howard for the link :) From there I came to know what exactly that message meant. Quoting from the guide itself:

Unfortunately, the BIOS has a design limitation, which makes it impossible to specify a track number that is larger than 1024 in the CMOS RAM, which is too little for a large hard disk. To overcome this, the hard disk controller lies about the geometry, and translates the addresses given by the computer into something that fits reality. For example, a hard disk might have 8 heads, 2048 tracks, and 35 sectors per track. Its controller could lie to the computer and claim that it has 16 heads, 1024 tracks, and 35 sectors per track, thus not exceeding the limit on tracks, and translates the address that the computer gives it by halving the head number, and doubling the track number. The mathematics can be more complicated in reality, because the numbers are not as nice as here (but again, the details are not relevant for understanding the principle). This translation distorts the operating system's view of how the disk is organized, thus making it impractical to use the all-data-on-one-cylinder trick to boost performance.
.
.
.
When using IDE disks, the boot partition (the partition with the bootable kernel image files) must be completely within the first 1024 cylinders. This is because the disk is used via the BIOS during boot (before the system goes into protected mode), and BIOS can't handle more than 1024 cylinders. It is sometimes possible to use a boot partition that is only partly within the first 1024 cylinders. This works as long as all the files that are read with the BIOS are within the first 1024 cylinders. Since this is difficult to arrange, it is a very bad idea to do it; you never know when a kernel update or disk defragmentation will result in an unbootable system. Therefore, make sure your boot partition is completely within the first 1024 cylinders.

Hope it clears the logic why Linux cries about 1024 cylinder issue at the time of installation.

You can read the guide online from the link above and download the pdf here. Its simple and concise and just too good. Small thing covering much :)

Sidhu

Monday, May 14, 2007

Run levels in *nix...

If you are crazy@*nix, 2 really interesting posts about run levels in *nix

Sidhu

Sunday, May 06, 2007

Using NTLDR to boot Linux...

Sometimes, while installing Linux, installing LILO/GRUB to MBR makes you run into loads of issues, one of the most popular being that after reboot you are not able to boot into either of the OS ;) There is a way to use NTLDR to boot Linux, this way the MBR remains untouched and if you don't want to see the Linux option, what you need to do is, edit your boot.ini and your are done.

For this while installing GRUB, install it to the partition where you are installing Linux, instead of MBR. Now after rebooting, Linux will not boot as the partition on which you installed GRUB is not active. What actually we will do is, copy first 512 bytes of the partition where GRUB is installed, make a bin file, copy it to C drive and add the path of the same to boot.ini. So now, when you select Linux from the list of options displayed, NTLDR will call GRUB and then GRUB will boot Linux, just like normal.

There is a small utility called bootpart that does this all for us. Here is the direct link. Extract it and go to command prompt.


C:\bootpart>dir
Volume in drive C has no label.
Volume Serial Number is 08E8-E412

Directory of C:\bootpart

05/05/2007 04:19 PM .
05/05/2007 04:19 PM ..
08/01/2005 02:26 AM 32bits
08/01/2005 02:06 AM 44,544 bootpart.exe
08/01/2005 02:06 AM 12,055 bootpart.txt
08/01/2005 02:06 AM 119 bootpart.url
08/01/2005 02:06 AM 383 file_id.diz
4 File(s) 57,101 bytes
3 Dir(s) 4,188,106,752 bytes free

Run bootpart, it will show all the partitions on the disk like

C:\bootpart>bootpart
Boot Partition 2.60 for WinNT/2K/XP (c)1995-2005 G. Vollant (info@winimage.com)
WEB : http://www.winimage.com and http://www.winimage.com/bootpart.htm
Add partition in the Windows NT/2000/XP Multi-boot loader
Run "bootpart /?" for more information

Physical number of disk 0 : 282d282d
0 : C:* type=7 (HPFS/NTFS), size= 25599546 KB, Lba Pos=63
1 : C: type=c (Win95 Fat32 LBA), size= 11751547 KB, Lba Pos=208828935
2 : C: type=d7 , size= 1052257 KB, Lba Pos=232332030
3 : C: type=f (Win95 XInt 13 extended), size= 78814890 KB, Lba Pos=51199155
4 : C: type=7 (HPFS/NTFS), size= 25607578 KB, Lba Pos=51199218
5 : C: type=5 (Extended), size= 35736592 KB, Lba Pos=102414375
6 : C: type=7 (HPFS/NTFS), size= 35736561 KB, Lba Pos=102414438
7 : C: type=5 (Extended), size= 15366172 KB, Lba Pos=173887560
8 : C: type=83 (Linux native), size= 15366141 KB, Lba Pos=173887623
9 : C: type=5 (Extended), size= 2104515 KB, Lba Pos=204619905
10 : C: type=82 (Linux swap), size= 2104483 KB, Lba Pos=204619968

Now the one in Red is my Linux partition. Now run bootpart 8 c:\linux.bin (Here 8 is my Linux partition number and linux.bin is the name of the file which it will create in C drive) It automatically adds the entry to boot.ini So now you are ready to go. Just reboot and you will see 2 options there. Windows & Linux :)

Happy NTLDR'ing...

Sidhu

Friday, May 04, 2007

Command line history in SQL (for Linux)...

Found a very interesting article on Dizwell's blog. It was about keeping history of the SQL commands in SQL Plus on Linux. It is almost very simple. Just need to download a small utility called rlwrap from here. Its a tar.gz file. Download it, un-tar using

tar -xvf rlwrap-0.28.tar.gz
It will create a directory with the same name. cd to the directory and run
./configure
Now do
make install
(I was logged in as oracle user, then did su, but it gave some errors, finally I logged in as root and it worked fine)

Now what is left to be done is make an alias for sqlplus as
alias sqlplus='rlwrap sqlplus'
Using up/down arrows, commands can be scrolled up and down just like windows. Have a look at full article here.

Cheers

Sidhu

Friday, March 16, 2007

Running Linux from inside Windows...

Running Linux from right inside Windows, just like a normal application !!! Idea looks cool. I was also searching for the same thing. After little bit of Googling got one link http://www.lifehack.org/articles/technology/beginners-guide-run-linux-like-any-other-program-in-windows.html This article explains everything about making it possible. (Thanks Kyle Pott :)

I had downloaded Fedore Core 7 Live CD. Tried same with this method. It is working perfectly fine. Rocking Infact !!! I have 1 Gigs of RAM in my laptop. It is giving good performance but will definitly rock with 2 Gigs.This is how it looks like on my laptop .



Cheers !
Sidhu

 
javascript:void(0); Preview