≡ Menu

storage devices

mount forcedirectio: Disable Linux CIFS / NFS Client Caching

If your network is heavily loaded you may see some problem with Common Internet File System (CIFS) and NFS under Linux. By default Linux CIFS mount command will try to cache files open by the client. You can use mount option forcedirectio when mounting the CIFS filesystem to disable caching on the CIFS client. This is tested with NETAPP and other storage devices and Novell, CentOS, UNIX and Red Hat Linux systems. This is the only way to avoid data mis-compare and problems.

The default is to attempt to cache ie try to request oplock on files opened by the client (forcedirectio is off). Foredirectio also can indirectly alter the network read and write size, since i/o will now match what was requested by the application, as readahead and writebehind is not being performed by the page cache when forcedirectio is enabled for a mount

mount -t cifs //mystorage/data2 -o username=vivek,password=myPassword,rw,bg,vers=3,proto=tcp,hard,intr,rsize=32768,wsize=32768,forcedirectio,llock /data2

Refer mount.cifs man page, docs stored at Documentation/filesystems/cifs.txt and fs/cifs/README in the linux kernel source tree for additional options and information.

Install and Run Debian Linux from an Encrypted USB Drive

Another interesting article with security in mind. From the article:

You're probably familiar with the live CD concept -- a fully functional operating system on a CD that can be run on any computer that boots from its optical drive, without affecting the one(s) already installed. In a similar vein, you can set up Linux to run from a USB hard drive drive on any computer that can boot from USB. The live system offers automatic detection and configuration of the display adapter and screen, storage devices, and other peripherals. A bootable USB drive can run a mainstream Linux distribution such as Debian GNU/Linux, and can be secured, personalised, upgraded, and otherwise modified to suit your needs.

=> Running Debian GNU/Linux from an encrypted USB drive