Recovering from Broken Grub

On Friday, i was trying to down-grade Grub to grub-legacy. So installed grub-legacy, i knew i was playing with bootloader. When i restart my OS, as expected grub was not able to find out the OS. Problem became more worsen when i came to know, i didn’t installed stage1, stage1.5 and stage2 scripts means i didn’t ran commands(grub-mkconfig).

Dos grub didn’t had grub-install, 

Grub Error

So i googled didn’t found any solution. I read from different blog, websites and tried this.

  1. Use any live os and run grub-install
First Mount the partition where OS is installed. You can find the partition by running. 

#$ blkid
/dev/sda1: UUID="ee51f4e9-1ef8-4b65-8ef4-299600e8cbf4" TYPE="ext4" PTTYPE="dos" PARTUUID="c679c6ed-01" 

/dev/sda2: UUID="cb97ec88-4282-459a-852f-f619138d46d9" TYPE="ext4" PARTUUID="c679c6ed-02"

then run 
sudo mount /dev/sda1 /mnt 
(Make sure partition in write mode)
mount -o remount, rw /dev/sda2
(Here sdb3 where OS is installed)

grub-install --target=/mnt --recheck /dev/sda2

Now Scripts are installed reboot the machine.(Most probably you will get a grub black screen)

Now you have to do 3 things

a. Find the partitions. 

ls

it will show you how many partitions are here,  here you may get like

(hd0) (hd0,5) (hd0,1) (hd1) (hd1,1) (hd1,2) (fd0) (hd0,msdos1) (hd0, msdos2)

Then run

ls /(hd0,0)

and observe the output, if you are getting Linux root(where folders like etc, boot are present) then this is your root.

b. Set the root

root (hd0,0)

Here (hd0,0) Explained Here.

  • The brackets are a must; all devices listed in GRUB menu must be enclosed in brackets.
  • hd stands for hard disk; alternatively, fd stands for floppy disk, cd stands for CD-ROM etc.
  • The first number (integer for geeks) refers to the physical hard drive number; in this case, the first drive, as they are counted from zero up. For example, hd2 refers to the third physical hard drive.
  • The second number refers to the partition number of the selected hard drive; again, partitions are counted from zero up. In this case, 1 stands for the second partition.

From here, it is evident that GRUB (menu) does not discriminate between IDE or SCSI drives or primary or logical partitions. The task of deciding which hard drive or partition may boot is left to BIOS and Stage 1. As you see, the notation is very simple.

Primary partitions are marked from 0 to 3 (hd?,0), (hd?,1), (hd?,2), (hd?,3). Logical partitions in the extended partition are counted from 4 up, regardless of the actual number of primary partitions on the hard disk, e.g. (hd1,7).

For me I guessed, i tried like setting up the root, like above mentioned then. used grub’s ls command if ls /boot+tab shows any thing that partition where you have to install actually re-install your Grub. 

c. Load the kernel

kernel /boot/vmlinux-linux  ro root=/dev/sda2

d. Load the Linux img

initrd /boot/vmlinux-linux-lts.img

Then Run

boot

You will be able to boot the desired OS. [1]

Link Aggregation LAG(IEEE 802.3ad)

Yesterday my colleague asked me about LAG, whats the meaning of LAG and what’s the use of it?

What does Link Aggregation (LAG) mean?

Link aggregation (LAG) is used to describe various methods for using multiple parallel network connections to increase throughput beyond the limit that one link (one connection) can achieve. For link aggregation, physical ports must reside on a single switch. Split Multi-Link Trunking (SMLT) and Routed-SMLT (RSMLT) remove this limitation and physical ports are allowed to connect/split between two switches. This term is also known as Multi-Link Trunking (MLT), Link Bundling, Ethernet/Network/NIC Bonding or NIC teaming.

Link Aggregation (LAG) :

Link aggregation is a technique used in a high-speed-backbone network to enable the fast and inexpensive transmission of bulk data. The best feature of link aggregation is its ability to enhance or increase the network capacity while maintaining a fast transmission speed and not changing any hardware devices, thus reducing cost. Cost Effectiveness LAG is a very common technique for establishing a new network infrastructure using extra cabling above the current requirements. Labor cost is much more than the cost of cabling. Thus, when a network extension is required, the extra cables are used without incurring any additional labor. However, this can be done only when extra ports are available. Higher-Link Availability This is the best feature of LAG. A communication system keeps working even when a link fails. In such situations, link capacity is reduced but data flow is not interrupted. Network Backbone Formerly, there were many techniques used for networking, but IEEE standards are always preferred. LAG supports network load balancing. Different load balancing algorithms are set by network engineers or administrators. Furthermore, network speed is increased by small increments, saving both resources and cost. Limitations With all kinds of implementations, each link and piece of hardware is standardized and engineered to not affect the network efficiency or link speed. Additionally, with single-switching all kind of ports (802.3ad, broadcast, etc.) must reside on a single switch or the same logical switch.

How to setup LAG in linux BOX

Thanx to Techopedia