Saturday, March 29, 2008

Faqs

1. When u press Alt+F2 and login in, which files are executed ?
Ans.
/etc/issue
$HOME/.hushlogin iff not exists
* mingetty checks for .hushlogin in $HOME
If $HOME/.hushlogin DOES NOT EXISTS then it does the foll :
- execs lastlog* -u $USER using /var/log/lastlog
- execs /etc/motd
- checks users mail, if any
/etc/profile
/etc/inputrc
/etc/termcap
/etc/profile.d/*.sh [13 shell scripts executed]
/etc/bashrc
$HOME/.bash_profile
Misc: $HOME/.bash_history
$HOME/.bash_logout
$HOME/.bashrc

2. LILO to GRUB : Change your bootloader
Ans.
# grub-install /dev/hda
Config file : /etc/lilo.conf
If you re-install Win$, you must boot from a boot floppy and do a 'lilo -v'

3. GRUB to LILO : Change your bootloader
Ans.
a. cp /etc/lilo.conf.anaconda /etc/lilo.conf
b. lilo -v [-t]
Config file : /boot/grub/grub.conf
: /etc/grub.conf [symlink to above]
If you re-install Win$, no effect on Linux since MBR does not contain
code except for a small loader which loads the main grub in 2 stages :
/usr/share/grub/i386-redhat/stage1 512 bytes
/usr/share/grub/i386-redhat/stage2 104K


4. To put a password in GRUB :
Ans.
password --md5 $1$JfobY0$HevBan5wGn.C/eteLH/jT1
# grub-md5-crypt
>> vashi123
>> vashi123
Now copy / paste this readable but scrambled password in grub.conf
It is the md5 encrypted equivalent of 'vashi123'

5. To uninstall Linux :
Ans.
# fdisk /dev/hda and delete all Linux partitions
# lilo -u Uninstall lilo
or
# Boot with Win$ startup disk
A:> fdisk /mbr
A:> Now reboot and you will have Win$ only

6. LILO : To create a boot floppy if your boot loader is LILO
Ans.
# uname -r
2.4.20-8
# mkbootdisk 2.4.20-8
Obviously the floppy should not be mounted !
Shorter version :
# mkbootdisk `uname -r`


7. GRUB : To create a boot floppy if your boot loader is GRUB
Ans.
Get a working floppy !
1. # mke2fs /dev/fd0
2. # mount /mnt/floppy
3. # cd /mnt/floppy
4. # mkdir -p boot/grub
5. # cd /boot/grub/
6. # cp stage1 /mnt/floppy/boot/grub/
7. # cp stage2 /mnt/floppy/boot/grub/
8. # cp grub.conf /mnt/floppy/boot/grub/
9. # grub --batch <<> root (fd0)
> setup (fd0)
> quit
> EOT
The moment you press Enter, a Boot grub floppy is created.
Boot with it to test it!


8. To Change the splash screen in grub :
Ans.
Using ImageMagick-5.4.7-10 software
* /usr/bin/identify -v bear.jpg
* /usr/bin/convert
* /usr/bin/animate
* /usr/bin/composite
* /usr/bin/conjure
* /usr/bin/display
* /usr/bin/import
* /usr/bin/mogrify
* /usr/bin/montage
Consider bear.jpg
1. convert -depth 8 -colors 14 -resize 640x480 bear.jpg bear.xpm
Has to be max 14 colors
Has to be 640x480 resolution
Has to be xpm format [X Windows System pixmap (color)]
See man ImageMagic
2. Now gzip the bear.xpm
# gzip bear.xpm -------> bear.xpm.gz
3. Copy it to /boot/grub/
# cp bear.xpm.gz /boot/grub/
4. Configure /boot/grub/grub.conf
splashimage=(hd0,11)/grub/bear.xpm.gz
5. reboot

No comments: