How to format old truenas boot ssd

Hi, i am pretty new to linux and truenas.
I build a truenas server a few months ago, had a boot ssd fail, swapped the ssd for a 256gb(only one i had spare). I got a new ssd and did a fresh install. Now i want to format the temporary 256gb ssd, but nothing i try seem to work. Windows can’t format, fdisk gives an error, gparted says it worked but nothing changed… i am out of Ideas… anyone have an idea?

Big thanks in advance!

Hi @Bietelboer, welcome to Level1!

While you didn’t say this with as many words I assume you are trying to reuse the 256GB ssd and run into issues. Based on prior Windows experience you assume that “format drive” will return your drive into a condition that allows reuse.

I think the root cause for your troubles is the current state of partitioning and initialization (choice of file system) of partitions (or lack thereof).

In 2024, any PC based storage should be organized using a GUID partition table (gpt). On modern PCs with UEFI (instead of older BIOS) Windows 10/11 even refuses to recognize storage that is organized using older MBR partition tables.
I think the best tool to check/correct this is gparted (because you mentioned it above). Follow the steps in the link to create a gpt partition table on your SSD. Note, that creating a new partition table will make any existing data inaccessible.

This step will likely make Windows installer recognize the drive (for a fresh install), also Windows should allow you to “create new partition” and “initialize” said partition. If you plan on using the drive with Windows in an ancient PC (or in BIOS compatibility mode) select “MBR” as partition table.

You can use gparted to create a new partition (at least one). Depending on your intended use you may want to format that parition in NTFS (for use in Windows) or select one of the Linux file systems of your choice (ext4, xfs, or btrfs).

Good luck!

Use something like MiniTool Partition Wizard Free to view and nuke the Linux partitions.

i tried, when i delete a partition it says job succesfully, but nothing changes… it is driving me crazy

i just want to Delete everything on the disk so i can use the disk for something else, but nothing seems to work… gparted says that it can’t change, fdisk says acces denied…

it looks like all the partitions are protected by something…

Sorry for the slow reply, as a father of two young boys with a fulltime job. my time is very limited to work on this.

the disk only contains a truenas scale install, nothing more… could it be some kind of protection?

You can use diskpart from a command prompt within Windows to fix it…

Diskpart is kinda weird to use (at first) but really helpful once you know how to use it. Install the drive you want to nuke and start up an elevated command prompt within Windows, then type ‘diskpart’. You should see something like this:

then type ‘list disk’ to get a listing of all the drives on yoursystem:

image

Make a note of the Disk ### that is one you want to remove all the partitions… I only have one drive in my system as I type this, so mine is ‘0’ but yours should be something else. Type ‘select ###’ where ### is the drive number you want to work with:

image

then type ‘list partition’ to get a list of partitions:

image

At this point, you need to ‘select’ and ‘delete’ each partition individually… In my above example, that means I would type “select partition 1”:

then type ‘delete partition’. I am not going to do that (obviously) but it should tell you the partition is deleted. You may get a message saying you need to “force” it to actually do it. I’d have to see the error message to remember for sure, but I think you just type “delete partition force”.

You then repeat the above steps until all the partitions are deleted. For example, after the first partition is deleted, you would type ‘list partition’, then ‘select partition ##’, then ‘delete partition’, and just keep repeating until all the partitions are gone.

Voila! It should then be able to be used as if it were fresh out of the box.

1 Like

In Linux you need root permissions for these actions.

Type sudo in front of any of your commands and enter your password when asked.

1 Like

tried all of this, but still no luck… it says succesfully deleted, but nothing changes… :frowning:


Maybe your SSD is bad :rofl:

The ssd was new, have the same thing with a different brand new ssd… :upside_down_face:

IM3CPO’s diskpart method works better than the windows gui version of the command. Especially when the gui version says there is no way to do it thru it.