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:
- Google Public DNS Down?
- lppasswd: Unable to open passwd file: Permission denied
- Missing /var/log/lastlog
- Telnet service_limit error
- Google accounts on Twitter
How to DENY SSH access for certain user on Linux
Due to some security reason, you may require to block certain user SSH access to Linux box.
Edit the sshd_config file, the location will sometimes be different depend on Linux distribution, but it’s usually in /etc/ssh/.
Open the file up while logged on as root:
vi /etc/ssh/sshd_config
Insert a line:
DenyUsers username1 username2 username3 username4
Referring to #man sshd_config:
DenyUsers
separated by spaces. Login is disallowed for user names that
match one of the patterns. â*â and â?â can be used as wildcards
in the patterns. Only user names are valid; a numerical user ID
is not recognized. By default, login is allowed for all users.
If the pattern takes the form USER@HOST then USER and HOST are
separately checked, restricting logins to particular users from
particular hosts.
Save it and restart SSH services. Basically username1, username2, username3 & username4 SSH login is disallowed.
Read more
Possibly Related Posts:
- Google Public DNS Down?
- lppasswd: Unable to open passwd file: Permission denied
- Missing /var/log/lastlog
- Telnet service_limit error
- Google accounts on Twitter
Block Blacklisted Domain in Squid
Squid can unconditionally block all outbound requests to certain domains. Privoxy is preferred for this, as privoxy will replace images with images, and squid will put in a dummy html page instead (which just means your pages will have broken images, no big deal). Other than that it will work just fine.
How do you block “Blacklisted Domain in Squid?” I used blacklist.current.domains file from sterns.org
Read more
Possibly Related Posts:
- lppasswd: Unable to open passwd file: Permission denied
- Missing /var/log/lastlog
- Telnet service_limit error
- How To Capture PUTTY Session Log
- How to Add Date And Time To Your Bash History on SuSE Linux