How to Check Filesystem Block Size on Linux?

The Linux file system architecture is an interesting example of abstracting complexity. The block size specifies size that the filesystem will use to read and write data. Larger block sizes will help improve disk I/O performance when using large files, such as databases. This happens because the disk can read or write data for a longer period of time before having to search for the next block.

For example, if you set your block size to 4096, or 4K, and you create a file that is 256 bytes in size, it will still consume 4K of space on your harddrive. For one file that may seem trivial, but when your filesystem contains hundreds or thousands of files, this can add up.

Block size can also effect the maximum supported file size on some filesystems. This is because many modern filesystem are limited not by block size or file size, but by the number of blocks. Therefore you would be using a “block size * max # of blocks = max block size” formula.

How to Check Filesystem Block Size on Linux?
Example 1:
# tune2fs -l /dev/sda1 | grep -i ‘block size’
Block size: 4096
Read more

Possibly Related Posts:


How to grep and display IP Address on Linux

How to find out an IP Address on Linux is pretty simple by type “ifconfig” command.

Output:

# ifconfig
eth0 Link encap:Ethernet HWaddr 01:2A:A1:3C:C3:27
inet addr:192.168.1.23 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:256125364 errors:0 dropped:0 overruns:0 frame:0
TX packets:203700834 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240597045 (229.4 Mb) TX bytes:3399069596 (3241.6 Mb)
Interrupt:16 Memory:f8000000-f8011100

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4760967 errors:0 dropped:0 overruns:0 frame:0
TX packets:4760967 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:480898269 (458.6 Mb) TX bytes:480898269 (458.6 Mb)

For some reason, you may want to display IP Address only. You can do it on multiple way and here you go:
Read more

Possibly Related Posts:


Introduce kSar – a SAR grapher

Last week I was working on consolidate Linux SAR graphical report and I found a great tool called kSar.

kSar kSar Version 5 is a java application that graph your sar data. It can graph sar text output from Solaris,Linux,AIX,HPUX,Mac OS/X. It also permit to export data to PDF/JPG/PNG/CSV.

How to run kSar from Windows XP machine?
1. Make sure you have java install
2. Make sure you have kSar download and installed
3. Copy over /var/log/sa/sar* to your local HDD.
4. Launch kSar from Windows XP MSDOS command line by type: java -jar kSar.jar
5. Load from sarXX text file.

kSar
Read more

Possibly Related Posts:


Check File Size Command on Linux

The “ls” command is the first command came into the my mind which used for files or directory listing on Linux. Beside that, you can try still check file size on Linux as show below:

  • ls -l FILENAME|/bin/awk -F” ” ‘{print$5}’
  • ls -l FILENAME | cut -d ” ” -f 5
  • du -b FILENAME
  • stat -c%s FILENAME
  • cat FILENAME |wc -c

Read more

Possibly Related Posts:


Linux “who am i” command

Linux “who” command is use to show who is logged on the Linux server.

For an example:

planetmy:~ # who am i
user1 pts/0 Feb 27 08:14 (192.168.1.145)

planetmy:~ # who am i|cut -d! -f2|cut -d\ -f1
user1

Yesterday, one of the Linux box show an empty result with “who am i” or “who” command.

If you look at “man who“,

If FILE is not specified, use /var/run/utmp. /var/log/wtmp as FILE is common. If ARG1 ARG2 given, -m presumed: `am i’ or `mom likes’ are usual.

Read more

Possibly Related Posts:


← Previous PageNext Page →

Planet Malaysia

  • Follow us on Twitter


  • web www.planetmy.com