Linux

Linux stuff

Nowadays most of servers come with two or more network interfaces to allow load balancing or fault tolerance. Debian supports bonding interfaces in the next way. Is recommended running these commands from the console. Install first ifenslave utilities # apt get install ifenslave-2.6 Stop networking running: # /etc/init.d/networking stop Now add the modules to be loaded editing the file /etc/modprobe.d/bonding with next lines alias bond0 bonding options bonding mode=1 miimon=100 downdelay=200 Read more...
Basic Commands Checking status of drive/arrays, displaying all raids and basic information # cat /proc/mdstat  Detailed status of array # mdadm --detail /dev/md2 Creating raid device # mdadm --create --verbose /dev/mdX --level=RAID5--raid-devices=2 /dev/sdj /dev/sdk  Stoping raid device # mdadm --stop /dev/md2  Adding a drive: # mdadm /dev/md2 -a /dev/sdm  Marking a drive as failed (This will break things if your not careful) # mdadm --manage --set-faulty Read more...
Labeling partitions y is very useful to identify volumes by naming rather than by partition number. To add the label "root" to the root partition, /dev/sda2, you should run: # tune2fs -Lroot /dev/sda2 # tune2fs -Lvar /dev/sda3 labeling swap partitions can be done with # mkswap -L label /dev/sda4 Once you've got a label you can check it running # cfdisk /dev/sda Now, some file must be updated to use this new naming. /etc/fstab - this file lists the partitions/file-systems which should Read more...
Sometimes we would like to access devices with a more friendly naming or unify naming with disks or devices. Normally USB disks naming depends the order you connect the disk, so if you want to set always the same name for a specific device to access it as /dev/ipod follow next rules to symlink to a new name. To link devices in /dev find the block device, for example with sdi USB disk. # udevinfo -q all -n /dev/sdi P: /block/sdi N: sdj and check which parameters we can use, here is the output Read more...