Using tune2fs to free up disk space.
We usually encounter issues, where a partition becomes 100% full, say if you get / as 100%, you even can’t edit the fstab entries.
In such instance, you can use the tune2fs command to free up disk space, since for every file system under Unix, approximately 5% of disk space is reserved for the “root” user.
To check this, take the ratio of Block count to the Reserved block count. (these values can be obtained by listing the information in the specified file system’s superblock.
tune2fs -l /dev/device (it should be a partition actually)
To free up all the reserved space use,
tune2fs -m 0 /dev/device, instead of 0, you can specify 1 or 2.
The only risk in setting zero reserved blocks is that, other Unix users can fill the file system to 100%.
ISCSI mount on boot
Steps to mount ISCSI on boot:
You can see the ISCSI drive while issuing “fdisk -l”. Let it be /dev/sdb1
Consider that you want it to mount over /vz partition.
step 1) e2label /dev/sdb1 /vz
step 2) In /etc/fstab, add the following entry.
LABEL=/vz /vz ext3 _netdev 0 0
step 3) chkconfig –level 3 netfs on
step 4) Reboot
Note:
ISCSI drives should be mounted with “_netdev” mount option.
“netfs” is the daemon which would mount the filesystems with “_netdev” mount option.
How to Backup MBR - Master Boot Record
The MBR (master boot record) is located at cylinder 0, head 0, sector 1. It’s the very first sector of the hard drive and it is 512 bytes in size. When the BIOS boots your machine it looks in the MBR for information on your partitions and the initial boot loader. The MBR contains a partition table and boot code. The boot code executes and then transfers the process to the bootloader program on your active(bootable) partition.
We can take the backup of MBR either to a floppy disk or to a CDROM.
1. Backup to a floppy:
dd if=/dev/hda of=/dev/fd0 bs=512 count=1
2. Backup to CDR:
First, create the MBR backup to a file on your hard drive.
dd if=/dev/hda of=mbr.bak bs=512 count=1
Now, burn the file you just created to CDR.
Change priority of swap files
You can check the current priority of the swap file from /proc/swaps.
Inorder to change the priority of the swap partitions, you need to edit the “fstab” and append the new priority. If you have the fstab entry for your swap file /swap1 as:
/swap1 swap swap defaults 0 0
then append the following:
/swap1 swap swap pri=x,defaults 0 0
where x is the new priority you have set.
You can re-mount it by using ‘mount -a’ command.
Struture of IPv6
The basic structure of IPv6
128 bits as the total
48 bits prefix to the site
16 bits for the subnets in the site
64 bits for host part
Also the stucture of IPv6 from left to right
3 bits: 001 (10% of the total address space reserved)
next 13 bits for the TLA ( Top Level Aggregator)
8 bits reserved
24 bits for the NLAs (Next level Aggregator)
16 bits for the site subnets = 65536 subnets
64 bits for the interface identifier
Total = 128 bits.
Address format of IPv6
Address Format is as follows. It is 128 bit ip address represented in Hexa decimal notation. An example is given below
2001:0000:1234:0000:0000:C1C0:ABCD:0876
this can be also represented as
2001:0000:1234:0:0:C1C0:ABCD:0876
When there are two consecutive zeros this can be represented also as
2001:0000:1234::C1C0:ABCD:0876
In browser you can access the site using ip. This can be done by putting square brackets as show below
http://[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]/
Also if you want to access a particular port give like this
http://[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]:8080