How to create a hidden file system in Linux using Shufflecake

Shufflecake is a simple but very powerful file system encryption utility for Linux. Unlike traditional drive encryption schemes, Shufflecake works by not only encrypting data within the file system but also hiding that data from the system itself.

This article will show you how to install Shufflecake on Ubuntu to create and maintain a hidden and encrypted file system in Linux.

Install Shufflecake

The first step to get Shufflecake is to install its dependencies onto your system. To do that, run the following command:

sudo apt install linux-headers-$(uname -r) libdevmapper-dev libgcrypt-dev make gcc

Download the latest tarball release from the project's Codeberg page.

How to create a hidden file system in Linux using Shufflecake Picture 1How to create a hidden file system in Linux using Shufflecake Picture 1

Navigate to the Downloads folder on your computer, then extract the release archive using Tar:

tar xzf ./Downloads/v0.4.4.tar.gz

Open the folder containing the Shufflecake source code, then run the following command to compile its binary on your system:

cd ./Downloads/shufflecake-c make

Note: Shufflecake compilation may take 2 to 5 minutes depending on your computer system resources.

Copy Shufflecake from the release folder to the binary path on your computer:

cp ./shufflecake /usr/bin/

Check if your machine can run Shufflecake properly from your system path:

shufflecake --help

Create dummy volume for Shufflecake

For the most part, Shufflecake can work on any type of block storage device. This includes physical disks as well as logical partitions. This is useful for creating an external drive with an encrypted file system while still being accessible as a regular device.

To create a dummy volume, open the Gnome Disks utility from your application launcher, then select the drive you want to format.

How to create a hidden file system in Linux using Shufflecake Picture 2How to create a hidden file system in Linux using Shufflecake Picture 2

Click the dotted button in the upper right corner of the window, then select Format Disk…

How to create a hidden file system in Linux using Shufflecake Picture 3How to create a hidden file system in Linux using Shufflecake Picture 3

Click the drop-down list next to the Erase: label, then select Overwrite existing data with zeroes (Slow).

How to create a hidden file system in Linux using Shufflecake Picture 4How to create a hidden file system in Linux using Shufflecake Picture 4

Select Format… to start the formatting process.

Once done, click the + icon to create a new partition on your drive.

How to create a hidden file system in Linux using Shufflecake Picture 5How to create a hidden file system in Linux using Shufflecake Picture 5

Provide a partition size equal to one-fourth of your total drive capacity. This will serve as unencrypted space on the drive that you can access without Shufflecake.

How to create a hidden file system in Linux using Shufflecake Picture 6How to create a hidden file system in Linux using Shufflecake Picture 6

Select the remaining Free Space block on the Disks utility, then click the + sign to create a new partition.

How to create a hidden file system in Linux using Shufflecake Picture 7How to create a hidden file system in Linux using Shufflecake Picture 7

Allocate all free disk space to your dummy partition. This will allow you to create multiple hidden volumes inside your Shufflecake drive.

 

Initial setting of hidden Shufflecake volume

At this point, you've got Shufflecake in your system's binary directory and a dummy drive partition. To create an encrypted file system from it, you need to initially set it up in Shufflecake.

Navigate to your release folder, then load the Shufflecake kernel module on your computer:

cd ./Downloads/shufflecake-c sudo insmod dm-sflc.ko

Run lsblk to find the drive letter where you want to install Shufflecake. In this case, the example will create a hidden volume inside the dummy partition '/dev/sda2'.

How to create a hidden file system in Linux using Shufflecake Picture 8How to create a hidden file system in Linux using Shufflecake Picture 8

Run the following command to initially set up Shufflecake for your dummy partition:

sudo shufflecake init /dev/sda2

Note: Shufflecake will only work on non-system drives. Running Shufflecake on the main drive will make your operating system unbootable.

This will run a wizard prompt where Shufflecake will ask you for details about your hidden volume. Type '5', then press Enter to create 5 hidden volumes.

Provide a password for each of your hidden volumes, then press Enter. Make sure you're in a private location before importing because the Shufflecake wizard won't hide your imports.

How to create a hidden file system in Linux using Shufflecake Picture 9How to create a hidden file system in Linux using Shufflecake Picture 9

Note: Initialization may take 5 to 10 minutes depending on the size of your partition.

Create a file system for your hidden volume

Once done, create the file system for your hidden volumes. To do this, open the hidden volume you want to format with the following command:

sudo shufflecake open /dev/sda2

This will prompt you to enter the password for the volume you want to open.

How to create a hidden file system in Linux using Shufflecake Picture 10How to create a hidden file system in Linux using Shufflecake Picture 10

Confirm that Shufflecake has correctly loaded your hidden volume by running lsblk.

How to create a hidden file system in Linux using Shufflecake Picture 11How to create a hidden file system in Linux using Shufflecake Picture 11

Create the file system you want to install on your hidden volume. For example, running mkfs.fat will create a FAT file system inside 'Volume 2':

sudo mkfs.fat -F 32 /dev/mapper/sflc_0_2

Note: Volume Shufflecake acts as a virtual device inside your computer. As such, you will always find its hidden volumes in '/dev/mapper/sflc_0_n' instead of the usual '/dev'.

Ubuntu will then automatically mount the new hidden volume to your current session. To access it, click the Drive icon on the left sidebar of the screen.

How to create a hidden file system in Linux using Shufflecake Picture 12How to create a hidden file system in Linux using Shufflecake Picture 12

Check if your file system is working properly by creating files or folders within it.

Unmount and convert hidden volumes

Unlike regular drives, unmounting a Shufflecake volume requires you to unmount the virtual volume and close its Shufflecake connection. To do this, Right Click on the drive icon on the Ubuntu taskbar, then select Unmount.

How to create a hidden file system in Linux using Shufflecake Picture 13How to create a hidden file system in Linux using Shufflecake Picture 13

Open a new terminal, then run the following command for your drive:

sudo shufflecake close /dev/sda2

You can also switch to another part of the Shufflecake drive by running sudo shufflecake open /dev/sda2 again, then providing the appropriate password for your hidden volume.

Change password for hidden volumes

In addition to creating and loading hidden volumes, the Shufflecake utility also allows you to modify the passwords of existing volumes. To do this, open a new terminal and run the following command:

sudo shufflecake changepwd /dev/sda2

Doing this will launch a wizard that will ask you for the password of the hidden volume you want to modify. Provide a password, then press Enter.

The wizard will then prompt you to enter a new password for your hidden volume. Write the new password, then press Enter to apply the new changes.

How to create a hidden file system in Linux using Shufflecake Picture 14How to create a hidden file system in Linux using Shufflecake Picture 14

Finally, test that the new password for your drive works correctly by running the testpwd subcommand:

sudo shufflecake testpwd /dev/sda2

How to create a hidden file system in Linux using Shufflecake Picture 15How to create a hidden file system in Linux using Shufflecake Picture 15

4 ★ | 1 Vote