Posts

Showing posts from January, 2011

Stop Wasting CDs; Install Linux Straight from an ISO

Image
All Linux installers use two files to boot a computer: a kernel and an initial root filesystem—also known as the RAM disk or initrd image. This initrd image contains a set of executables and drivers that are needed to mount the real root filesystem. When the real root filesystem mounts, the initrd is unmounted and its memory is freed. These two files are named differently in different distros—refer to Table 1 for their names. Table 1: Names of kernel and RAM disk images in some popular distros Distro Kernel path RAM disk path Fedora /isolinux/vmlinuz /isolinux/initrd.img RHEL5/CentOS5 /isolinux/vmlinuz /isolinux/initrd.img openSUSE /boot/i386/loader/linux /boot/i386/loader/initrd Mandriva /i586/isolinux/alt0/vmlinuz /i586/isolinux/alt0/all.rdz Ubuntu /casper/vmlinuz /casper/initrd.gz Debian /install.386/vmlinuz /isolinux/initrd.img The first thing you need to do is place the ISO image(s) inside a directory. Some installers are not able to r...

Recovery of deleted /etc/passwd File in Linux

In that case you need to recover /etc/passwd file first. For this you have to following steps, -Start GRUB on boot (press ESC while booting) -Press e over (recovery mode) -Press e over the line beginning with kernel -Press Space bar and enter "init=/bin/bash" -Press enter -Press b -At command prompt type: "cp /etc/passwd- /etc/passwd" -reboot to GRUB again -Press e over (recovery mode) -Press e over the line beginning with kernel -Press Space bar and enter "init=/bin/bash" -Press enter -Press b -At command prompt type "mount -o remount,rw /" -Type "passwd YOURUSERNAMEHERE" (IF you don't know your user name type "ls /home" (that is a Lower case L and lower case S) for a list of users) -Enter new password at prompt -reboot to normal boot. Hope that helps others like it did me! ### Then to recover /etc/shadow file, Use following command pwconf This command will generate /etc/shadow file from /etc/passwd Enjoy Linux!!

Delete all lines containing a pattern(vi and sed)

Image
sed : sed ( s tream ed itor ) is a Unix utility that parses text files and implements a programming language which can apply textual transformations to such files. It reads input files line by line (sequentially), applying the operation which has been specified via the command line (or a sed script ), and then outputs the line. It was developed from 1973 to 1974 as a Unix utility by Lee E. McMahon of Bell Labs, and is available today for most operating systems. How to remove Blank Lines or some line starting from particular pattern.    Here Suppose I want to remove the Blank Lines and Lines starting with #. Original File : [root@gateway ~]# cat a Default: # sleep_after_fork 0 #  TAG: max_filedesc #       The maximum number of open file descriptors. # #       WARNING: Changes of this value isn't respected by reconfigure         command. This value should be...