Category: Reliable Penguin

XFS Requires “inode64” On Large Filesystems

Recently ran into a problem with a large distributed GlusterFS filesystem. All of a sudden we started getting errors about no free space on device when trying to write files. The individual bricks on the distributed GlusterFS filesystem were hosted on XFS formatted partitions. After some investigation we found that when the size of the brick’s XFS filesystem exceeded 16TB the “no free space” errors started. The solution was to add “inode64” to the mount options for the XFS partition. The XFS FAQ states the following: By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like “disk full” when you still have plenty space free, but there’s no more place in the first TB to create a new inode. Also, performance

Read More »

How To Clear btmp File

Running low on storage. Check the /etc/btmp file where failed login attempts are logged. This file may be very large:

The file can be cleared like this:

Credit for this goes to Tournas Dimitrios who has a great article on btmp: https://tournasdimitrios1.wordpress.com/2010/12/28/how-to-clear-and-delete-last-logged-in-users-and-bad-login-attemps-log-wtmp-and-btmp/

Read More »

Redirect Generator

Happened onto this “301 Redirect Generator” page today: http://www.rapidtables.com/web/tools/redirect-generator.htm What’s notable is that it can generate PHP, ASP, ASP.Net, .htaccess, HTML meta tag and Javascript redirects. I used it to generate some redirects on a Windows server in ASP.Net. Noted too is the lack of support for Web.config HTTP Redirects and Nginx. Anybody know of a better tool for generating redirects?

Read More »

Using SSHFS To Mount Remote Filesystem

If you need to do a lot of file operations against a remote ssh/sftp server then sshfs might be the perfect tool. sshfs is a FUSE filesystem that you can mount onto a local mount point. Once mounted you can manipulate the files as if there were local. Here’s the project site: http://fuse.sourceforge.net/sshfs.html You might need to install with yum or apt-get:

After sshfs installed you can use it like this:

You’ll be prompted for a password unless you has keys setup with the remote server. Now you can copy files to and from under mymount/.

Read More »

Chrooted SFTP Users

Here’s the steps to create chrooted SFTP users. 1. Comment out the following line in /etc/ssh/sshd_config

2. Append the following in /etc/ssh/sshd_config

where USERNAME is the user and ChrootDirectory is the path that the user will be locked into. Add a new “Match User” stanza for each user that needs to be chrooted.  This allows each user to have a unique directory. 3. Restart SSH

4. Create the SFTP user group

5. Modify the user

SCP and SSH are not allowed with this setup but you could change the shell to allow them…

6. The highest directory in the chroot tree must be owned by user/group root

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.