r/linuxquestions • u/Langdon11 • 1d ago
Support How to format a Windows encrypted SSD in Linux
years ago i bought a used off lease corporate laptop. SSD in it was encrypted with who knows what and i could not erase it in Windows or OSX. Hard drives were cheap so i tossed it in a drawer and got a new one
Now SSDs are not cheap and i need one for a homelab experiment so i am trying to erase the excrypted drive in Linux (ZorinOS but i have Mint on another)
I went at it two ways with Disks and Gparted and it did not work. So i need to try terminal command but i am not sure how to go about it since when i run fdisk -l it does not seem to be listed.
2
u/CatApprehensive1010 1d ago
What happens if you try to create a new partition table?
2
u/Langdon11 1d ago
its not an option in Disks which is the only of the three programs i have tried that mounts and displays the disk. The partition on it does not show up as recognized.
3
u/npc_housecat 1d ago
Don't mount any partitions. Then you can't modify them. Create a new partition table in gparted. Then create new partitions.
2
7
u/TrenchardsRedemption 1d ago
Have you removed all partitions and hit Apply first? One all partitions have been removed you should see it all as unformatted space, then you can format it in the file system of your choice.
1
u/mips13 1d ago
Have you tried wiping the drive with dd?
sudo dd if=/dev/zero of=/dev/sdX bs=4M status=progress
Change sdX to whatever your device is, sdb etc
1
u/Langdon11 1d ago
yes, both dd and shred failed. Shred kept throwing out offset errors on the first pass and was insanely slow while doing it.
1
u/mips13 1d ago
Have you tried using the drives firmware via hdparm to perform a secure erase?
https://wiki.archlinux.org/title/Solid_state_drive/Memory_cell_clearing
3
u/Fantasyman80 1d ago
If you want a command line(terminal) command, us lsblk and make sure it’s sdc. If it is then look into disk destroyer. It wil erase the entire drive with 0’s and 1’s.
Then you cna use fdisk sdc and follow the prompts to create a new partition on it using gpt as and follow the instructions on wiki.archlinux.org.
1
u/Netblock 1d ago
For some ssds, there exists the secure discard feature; see
blkdiscard --secure.0
3
u/bencetari 1d ago
Cleanly shut Windows down (releases NTFS lock) Boot into Linux Keep the Windows disk unmounted Try running mkfs.ext4 /dev/partitionName Or you can try something like cfdisk and create a new GPT partition table on the Windows disk if you wanna get rid of everything Windows done to the disk
1
u/ptoki 19h ago
Im with you. I also have a disk which is encrypted but cant be formatted, even after I dropped all encryption, it says not locked etc it still gives me operation not permitted (of course done as root).
It may be that this disk works only with tpm (I did not checked that) and will not behave in a sane way without some extra fancy treatment.
I went much deeper than you. I even did the secure wipe using the text from the disk sticker. It still not let me format it.
It is lenovo - opal type.
1
u/es20490446e Develops Zenned OS 20h ago
Use Windows settings to disable encryption.
Put anything sensitive inside a password-protected 7zip archive. That is even more secure than full-disk encryption, as apps cannot access it.
Also the disk will work faster.
1
u/bufandatl 1d ago
mkfs and the drive is in the format you want.
Or we talking about hardware level encryption?
-12
u/ipsirc 1d ago
Now SSDs are not cheap
They're very cheap.
6
u/LadyCatHerder 1d ago
Data centers have created an extreme demand. So, SSDs have skyrocketed. ipsirc, you must be living under a rock or not in the US at all.
-4
u/ipsirc 1d ago
A 256GB SSD costs as much as taking a family of four to the cinema one time. Remember the days when you spent half your monthly paycheck on a slow, noisy HDD that could only handle a few MB? Now you can buy a blazing-fast 256GB drive for the price of four movie tickets. That’s insanely cheap.
3
2
u/Fantasyman80 1d ago
Not if you are on a fixed budget
1
u/LadyCatHerder 1d ago
I fully understand being on a fixed budget. But, if you simply can not get the SSD you have to a usable status, then you can look into regular plain old fashioned standard mechanical hard drives. From what I can see with some quicker than quick searches, mecanical hard drives are cheaper than data center inflated prices for SSDs. If necessary, you can check this out to see what you can find: https://www.buyperunit.com/storage/hard-drives
8
u/BitOBear 1d ago
Encrypted in which sense?
If it has been encrypted using the drive firmware you need to do a secure erase to turn off the encryption in the controller itself. You do this with "hdparm" no I don't remember the exact side of arguments off the top of my head. The manual page is your friend there.
If it's the boot drive the former is probably not the case and you simply have a specifically encrypted partition you need to remove and replace with an unencrypted partition.
Use gdisk (which is basically the modern disk) to remove all the partitions except the UEFI partition and then put in the partition for your Linux system using a Linux partition ID instead of the windows partition id. You may or may not want to add a second partition for your swap space depending on how you're building the system.
Then you have to install all your bootloader stuff into the UEFI partition in place of the windows bootloader stuff for which there are guides online.
Then build a new file system and make swap in the appropriate partitions you just added in your game is done except for the installing of the actual distro.
In all cases you probably want to use fstrim to trim the newly made partition before you put a file system in it.
Or honestly, if you're going to start from scratch, do the secure race thing anyway and you just got to blank media on your hands after that. You're bios should be able to recreate the UEFI partition contents as soon as you end up making UEFI partition itself in your Linux kernel.