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
How To Raise Capital - Capital Raising Strategies | Ansarada
10 Bible Verses About Stewardship of Money
Pollen Count Centreville Va
Golden Abyss - Chapter 5 - Lunar_Angel
Was ist ein Crawler? | Finde es jetzt raus! | OMT-Lexikon
Craigslist Niles Ohio
Pga Scores Cbs
Rainbird Wiring Diagram
Mustangps.instructure
Lenscrafters Westchester Mall
Mylife Cvs Login
Xm Tennis Channel
Edgar And Herschel Trivia Questions
FIX: Spacebar, Enter, or Backspace Not Working
‘Accused: Guilty Or Innocent?’: A&E Delivering Up-Close Look At Lives Of Those Accused Of Brutal Crimes
Citymd West 146Th Urgent Care - Nyc Photos
Lonadine
Belly Dump Trailers For Sale On Craigslist
Nj State Police Private Detective Unit
6813472639
Aberration Surface Entrances
Used Sawmill For Sale - Craigslist Near Tennessee
Soccer Zone Discount Code
Dtab Customs
Grandview Outlet Westwood Ky
Hobby Stores Near Me Now
Marion City Wide Garage Sale 2023
Craigs List Tallahassee
8005607994
Malluvilla In Malayalam Movies Download
The Procurement Acronyms And Abbreviations That You Need To Know Short Forms Used In Procurement
In hunt for cartel hitmen, Texas Ranger's biggest obstacle may be the border itself (2024)
Datingscout Wantmatures
Issue Monday, September 23, 2024
Swgoh Boba Fett Counter
Serenity Of Lathrop - Manteca Photos
Tamil Play.com
Blue Beetle Movie Tickets and Showtimes Near Me | Regal
Marie Peppers Chronic Care Management
Honda Ruckus Fuse Box Diagram
Wo ein Pfand ist, ist auch Einweg
T&Cs | Hollywood Bowl
Andrew Lee Torres
Sound Of Freedom Showtimes Near Lewisburg Cinema 8
Jamesbonchai
Courses In Touch
Memberweb Bw
Dr Mayy Deadrick Paradise Valley
Zom 100 Mbti
Craigslist Free Cats Near Me
Sitka Alaska Craigslist
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.