Create Encrypted Volume

This little guide will go through how to create and encrypted volume on linux. It assumes that you already have the programs necessary. Many distributions already have them installed. If you system is using apt package management you can install the necessary tools with

apt-get install cryptsetup

In this example we assume that the volume we want to encrypt is /dev/sdc, a partition sdc1 will be create were we then create a file system on.

Check file fragmentation in Linux

All file systems get fragmented. some more then others.

To check file fragmentation of a file under linux you use the program filefrag


Show file fragmentation of a file

Example of how the output may be

> filefrag 16 extents found

If you want more information you can add the verbose (-v) flag

Set harddrive sleep timeout

If your harddrives are idle a lot it is good practice to let them enter standby mode. both to save some energy but also to protect the harddrives of one if its most dangerous enemies. Heat!

To set the harddrive idle time you need to have the command hdparm.

To set the spindown to 20 min use

sbin/hdparm -S 240 /dev/hdb
/dev/hdb: setting standby to 240 (20 minutes)

To check if an HD is running or is in standby mode you can to

Subscribe to Linux