Posts

Showing posts from February, 2015

How To Change MTU Value Of Network Interface In Linux

MTU (Maximum Transmission Unit) is related to TCP/IP networking which refers to the size (in bytes) of the largest datagram that can be pass at a time. We can see current MTU value as below : $ifconfig eth0 eth0      Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0          inet6 addr: fe80::20f:eaff:fe91:407/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:141567 errors:0 dropped:0 overruns:0 frame:0          TX packets:141306 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:101087512 (96.4 MiB)  TX bytes:32695783 (31.1 MiB)          Interrupt:18 Base address:0xc000 OR ...

How to run fdisk in non-interactive mode

fdisk is a command-line utility for disk partition management.If you are going to create one or two partition then its okay to go with manual user intracetion method of fdisk. But if the partition list is a bit longer or we can say its repitative for several machines then need to seek some automation , here we go for probable two solutions for this : - Solution - I : Using below shell script #!/bin/sh sdd="/dev/sdb /dev/sdc /dev/sdd" for i in $sdd do echo "n p 1 t 8e w "|fdisk $i;pvcreate "$i"1;done n = Create new partition p = Primary partition 1 = 1st partition of primary type t = Partition type 8e = Linux LVM Note: two consicuitve blank lines between 1 and t . Solution - II : Using sfdisk Utility This tool allows you to create/change partition tables according to the disk partitioning specification read from standard input. It also allows you to export the partition table specification of a device to a file, so tha...