Encrypt pendrive with LUKS (2024)

Have you ever wanted to own an encrypted pendrive which will be unreadable and uncrackable (with strong enough password) to third parties without your password?

Your files on laptop may be encrypted and safe but what about the files on pendrives you use? Removing a file from unencrypted pendrive does not make it impossible to retrieve it. Encrypt a pendrive and you can be always safe.

Password for encrypted pendrive can easily be changed without modifying or erasing the pendrive contents.

In this episode we will encrypt pendrive with LUKS and format it with ext4or ntfs filesystem. Your pendrive data will be removed in the process so back it up.

Switch to root.

su -

Put the pendrive in and list all disks in order to find your pendrive.

lsblk
Encrypt pendrive with LUKS (2)

Locate your pendrive. My pendrive called 64GB is device/dev/sdb with one partition /dev/sdb1 mounted under /run/media/andrzej.rehmann/64GB .

Move all your data to a save place as we will remove all pendrive content.

Unmount pendrive and check the result.

umount /dev/<pendrive_partition>
lsblk
Encrypt pendrive with LUKS (3)

We will now encrypt the pendrive. This will remove all pendrive contents.

cryptsetup luksFormat /dev/<pendrive_device>
Encrypt pendrive with LUKS (4)

That’s it. Pendrive is now encrypted but is not usable yet.

We will now create filesystem on our pendrive.

First let’s decrypt/open it.

cryptsetup luksOpen /dev/<pendrive_device> <luks_name>
lsblk

Where <luks_name> is some random string of your choosing (this is not a persistent name, don’t worry).

Encrypt pendrive with LUKS (5)

You can overwrite pendrive with shredto wipe it’s previous content but it can take a while. I’m not going to do this.

shred -n 1 mapper/<luks_name>

Create file system. I’m using ext4, but you can choose other filesystem like NTFSor FAT.

For ext4 which will work on Linux no problem but will require additional software on Windows use:

mkfs -t ext4 -L "<label>" /dev/mapper/<luks_name> # Ext4

Ext4 is a journalling filesystem which means that if the device is unplugged prematurely it stands more of a chance of recovering the damaged filesystem. It can support volumes up to 1 ExbiByte (a lot).

For NTFS which should work on Windows no problem but may require additional software on some Linux distributions use:

mkfs -t ntfs -L "<label>" /dev/mapper/<luks_name> # NTFS

Where <label> is your new pendrive name.

Encrypt pendrive with LUKS (6)

After mkfs is finished pull out the pendrive and plug it back in. You should see a modal window asking for you pendrive password.

Encrypt pendrive with LUKS (7)

If you don’t see this window open file browser and click on the pendrive as if you wanted to browse its content. You should be asked for a password then.

Encrypt pendrive with LUKS (8)

It’s done. You can check that indeed your pendrive is now encrypted.

lsblk
Encrypt pendrive with LUKS (9)

If you see the luks-UUID as the partition name it means that that partition is encrypted. My /dev/sdc (it switched from /dev/sdb ) pendrive is now encrypted.

The last step is necessary only if you used ext4 file system. Your pendrive is owned by root user at the moment so you won’t be able to write to it, we need to fix this.

chown -R <user>:<user> <pendrive_mount_point>
Encrypt pendrive with LUKS (10)

No my pendrive is owned by my user and ready to use.

Encrypt pendrive with LUKS (11)

If you are interested with installing a Fedora 26 with ZFS and encryption then check out my series here: https://medium.com/@AndrzejRehmann/preparing-fedora-laptop-with-zfs-and-encryption-part-1-f5788dda79ab

Encrypt pendrive with LUKS (2024)
Top Articles
Top Forex Brokers in South Africa: trading CFDs, Gold, and Cryptocurrencies - TopForex.Trade
How To Generate Passive Income With T-shirts - Monique Malcolm
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Gov. Deandrea McKenzie

Last Updated:

Views: 5827

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Gov. Deandrea McKenzie

Birthday: 2001-01-17

Address: Suite 769 2454 Marsha Coves, Debbieton, MS 95002

Phone: +813077629322

Job: Real-Estate Executive

Hobby: Archery, Metal detecting, Kitesurfing, Genealogy, Kitesurfing, Calligraphy, Roller skating

Introduction: My name is Gov. Deandrea McKenzie, I am a spotless, clean, glamorous, sparkling, adventurous, nice, brainy person who loves writing and wants to share my knowledge and understanding with you.