Just got a 16 GB PNY flash drive from Wal-Mart and formatted it to ext4. Any idea how I could put access security on the drive? I would prefer security to protect against other OSs as well. Thanks.

Dani AI

Generated

Quick summary tied to the replies already here: if the stick will stay Linux-only, use LUKS/cryptsetup; if you need Windows/macOS access as well, use a cross-platform tool (VeraCrypt) and make the on-disk filesystem readable by those OSes first. ’s pointer toward cryptsetup is the usual Linux-first answer; ’s TrueCrypt suggestion historically led people to VeraCrypt today, but TrueCrypt itself is deprecated. (man7.org)

Practical Linux-first workflow (safe, simple): back up the data, run a fresh LUKS format on the device, open it with cryptsetup, create an ext4 filesystem inside the mapped device, then copy your files back. After that immediately create a detached LUKS header backup and store it offline — if the header or passphrase is lost the data cannot be recovered. Always test that you can open the new encrypted volume before erasing your original backup. (man7.org)

If you need read/write on Windows and macOS as well, reformat the stick to a cross-platform host FS (exFAT or NTFS) and put an encrypted container (or a partition-hosted VeraCrypt volume) on it. VeraCrypt is the actively maintained successor used for portable, cross-OS encrypted volumes; it supports file-hosted containers (good for USB sticks) and device/partition encryption. For convenience with cameras/phones and broad compatibility, exFAT is commonly used as the host filesystem. (github.com)

Important cautions about data loss and flash media: encryption or formatting operations can overwrite data irrevocably; losing the passphrase or a header can make the volume unreadable. On USB flash and many SSDs beware wear-leveling and remapped sectors — in-place encryption or header overwrites may not behave as you expect, so prefer file-hosted containers or full reformat + encrypt only after a verified backup. Test mounts, keep a secure copy of header/rescue info, and use a strong, memorable passphrase or a password manager. (veracrypt.io)

Recommended Answers

All 3 Replies

As cereal mentions, to do this you need to encrypt the drive. There are a number of tools to do this, including TruCrypt: http://www.truecrypt.org/

Is there a danger of data loss when encrypting information?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.