this post was submitted on 26 Dec 2025
-54 points (34.1% liked)

Selfhosted

53971 readers
890 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Did I just brick my SAS drive?

I was trying to make a pool with the other 5 drives and this one kept giving errors. As a completer beginner I turned to gpt.....

What can I do? Is that drive bricked for good?

Don't clown on me, I understand my mistake in running shell scripts from Ai...

EMPTY DRIVES NO DATA

The initial error was:

Edit: sde and SDA are the same drive, name just changed for some reason And also I know it was 100% my fault and preventable 😞

**Edit: ** from LM22, output of sudo sg_format -vv /dev/sda (broken link)

BIG EDIT:

For people that can help (btw, thx a lot), some more relevant info:

Exact drive model: SEAGATE ST4000NM0023 XMGG

HBA model and firmware: lspci | grep -i raid 00:17.0 RAID bus controller: Intel Corporation SATA Controller [RAID mode] Its an LSI card Bought it here

Kernel version / distro: I was using Truenas when I formatted it. Now trouble shooting on other PC got (6.8.0-38-generic), Linux Mint 22

Whether the controller supports DIF/DIX (T10 PI): output of lspci -vv (broken link)

Whether other identical drives still work in the same slot/cable: yes all the other 5 drives worked when i set up a RAIDZ2 and a couple of them are exact same model of HDD

COMMANDS This is what I got for each command: (broken link)


Solved by y0din! Thank you soo much!


Thanks for all the help 😁

top 50 comments
sorted by: hot top controversial new old
[–] Wispy2891@lemmy.world 1 points 1 day ago

I notice that you used the free interface without registration. While a bit of a hassle to register, I saw that behind the registration wall they use longer contexts/bigger models. Without registration it's more prone to abuse so they might condense/truncate responses from chats: by design, the bots have zero memory, so the whole chat history needs to be appended at every question => long chats lead to expensive API calls => free users get history truncated or condensed.

Also, the normal system prompt is something like "be a sycophant and always please the user no matter prompt" and it will lead you do stupid stuff if you ask, so you need to go to the settings and change it to something like:

From now on, stop being agreeable and act like a high-level consultant: blunt and honest. Don’t validate me, don’t soften the truth, and don’t flatter me. Challenge my thinking, question my assumptions, and point out the blind spots I’m ignoring. Be direct, rational, and unfiltered. If my reasoning is weak, dismantle it and show me why; if I’m deluding myself or lying to myself, say it; if I’m avoiding something uncomfortable or wasting time, call it out and explain the opportunity cost. Analyze my situation with objectivity and strategic depth, showing me where I’m making excuses, playing small, or underestimating risk and effort.

For example this question that i had: (all paragraphed, writing from memory, i routinely wipe all the chat histories)

can I bypass gpg verification on fedora when using dnf?

gpt-5-mini from chatgpt free:

it's absolutely possible! just use the --nogpgcheck flag

gpt-5.2 from api with the previous system prompt:

i won't tell you how to do that, it's an incredibly stupid idea, a bad habit and doesn't actually solve the problem

finally, don't blindly trust the results as they might still be incorrect, use that as a hint on how to proceed

[–] artyom@piefed.social 37 points 3 days ago

No, you fried your drive, by listening to CGPT. Also learn how to take a screenshot.

[–] recklessengagement@lemmy.world 147 points 3 days ago* (last edited 3 days ago)

ChatGPT didn't fry your drive. You fried your drive.

You should be looking up these commands and flags before you run them.

[–] DieserTypMatthias@lemmy.ml 8 points 2 days ago

Don't trust a chatbot.

[–] 6nk06@sh.itjust.works 121 points 3 days ago (24 children)

As a completer beginner I turned to gpt

I tell people not to do that all the time. They'd rather listen to the statistical vomit machine.

load more comments (24 replies)
[–] irmadlad@lemmy.world 33 points 3 days ago* (last edited 3 days ago) (2 children)

OP, I am sorry that I cannot offer any immediate solution to your issue. However, if I may, pass along a bit of advice I learned long ago, and it has nothing to do with AI. TAKE PROLIFIC NOTES!!! It is tedious, it is work, but it will save your ass in the long run. Write everything down. Don't be lulled into the mindset that you will be able to remember each and every thing you've done to the server, especially when you're breaking new ground in your selfhosting journey. 9 times out of 10, you won't. Then when you are successful with your endeavors, go back, clean up your notes, and store them for future reference.

[–] zebidiah@lemmy.ca 5 points 2 days ago (2 children)

It doesn't really need to be tedious... My notes are jokey, full of profanity, sarcasm, and self deprecating humor

for context, these are my personal notes for my personal machine. These will never be shared with anyone else, and nobody else has to try to read them or make sense of them (well... sometimes I make chatbot read my notes in order to train it on whatever I need help troubleshooting)

Before I started keeping a hot_log.txt file every single install of Linux I ever ran was a unique snowflake and no two systems were ever the same

[–] jerkface@lemmy.ca 4 points 2 days ago* (last edited 2 days ago)

It doesn’t really need to be tedious… My notes are jokey, full of profanity, sarcasm, and self deprecating humor

So worse than tedium.

[–] irmadlad@lemmy.world 5 points 2 days ago

My notes are jokey, full of profanity, sarcasm, and self deprecating humor

I meant tedious, as in, it takes some effort to pause, write the shit down, and then proceed on. I can only speak for myself, but when I'm in the zone doing something, excitement can overshadow note taking. So, I have to make myself document line by line. But, yeah I have entries like 'Before proceeding, make sure you do _____ , dumbass!' LOL

load more comments (1 replies)
[–] y0din@lemmy.world 48 points 3 days ago* (last edited 3 days ago) (10 children)

Right now there isn’t enough information to conclude that the drive is “bricked”.

sg_format on a SAS drive with DIF enabled can absolutely make the disk temporarily unusable to the OS if the format parameters no longer match what the HBA/driver expects, but that is very different from a dead drive.

To make any determination, more data is required. At minimum (boot with a live Linux USB drive if you are unable to get to this information):

Please provide verbatim output from:

  • dmesg -T (from boot and when the drive is detected)
  • sblk -o NAME,MODEL,SIZE,PHY-SeC,LOG-SeC
  • fdisk -l /dev/sdX
  • sg_inq /dev/sdX
  • sg_readcap -l /dev/sdX
  • sg_modes -a /dev/sdX

Also specify:

  • Exact drive model
  • HBA model and firmware
  • Kernel version / distro
  • Whether the controller supports DIF/DIX (T10 PI)
  • Whether other identical drives still work in the same slot/cable

Common possibilities (none can be confirmed without logs):

  • Drive formatted with DIF enabled but HBA/OS not configured for it
  • Logical/physical block size mismatch (e.g. 520/528 vs 512/4096)
  • Format still in progress or left the drive in a non-ready state
  • Mode pages changed that Linux does not like by default

Things that are usually recoverable on SAS drives:

  • Re-formatting with correct sector size and DIF disabled
  • Clearing protection information
  • Power-cycling the drive after format completion
  • Formatting from a controller that fully supports the drive’s feature set

Actual permanent bricking from sg_format alone is rare unless firmware flashing or vendor-specific commands were involved.

Until logs are posted, all anyone can honestly say is:

The drive is not currently usable, but there is no evidence yet that it is permanently damaged.

If you can share this information it might be possible to get the drive back online, though I make no promises.

(edit typos)

[–] y0din@lemmy.world 7 points 2 days ago* (last edited 2 days ago)

One more hopefully happy update:

Based on everything you’ve shown so far in the information you have given, the most probable cause is that the drive was formatted with T10 DIF / Protection Information enabled (PROTECT=1), and you are now accessing it through a controller path that does not support DIF.

This is a very common failure mode with enterprise SAS drives and sg_format.

(edit: oh, how I am in a love/hate relationship with my brain on delayed thoughts...)

In your paste from sg_format you can see this flag:

sudo sg_format -vv /dev/sda open /dev/sda with flags=0x802 inquiry cdb: [12 00 00 00 24 00] SEAGATE ST4000NM0023 XMGG peripheral_type: disk [0x0] PROTECT=1

(end of edit)

What this means in practice:

  • PROTECT=1 = the drive was formatted with DIF Type 1
  • Logical blocks are no longer plain 512/4096 bytes (e.g. 520/528 instead)
  • The HBA + driver must explicitly support T10 PI
  • If the controller does not support DIF, the drive may:
    • Be detected
    • But fail all I/O
    • Appear “dead” even though it is healthy

This is not bricking. It is a configuration mismatch.

How to fix it (most reliable path)

You need to connect the drive to a DIF-capable SAS HBA (LSI/Broadcom, same type as originally used if possible).
Best option is to do this on the original hardware, even via a USB live Linux environment.

Once the drive is on a T10-capable controller, reformat it with protection disabled.

Example (this will ERASE the drive and might take a LONG time to complete):

sudo sg_format --format --size=512 --fmtpinfo=0 --pfu=0 /dev/sdX

Key flags:

  • --fmtpinfo=0 → disables DIF / PROTECT
  • --size=512 (or 4096 if you prefer standard 4K)
  • --pfu=0 (disables PROTECTION flag, your GPT forgot to include this which actually disables the protection)
  • Use the correct /dev/sdX

After this completes and the system is power-cycled, the drive should behave like a normal disk again on non-DIF controllers.

Important notes

  • sg_format alone almost never permanently damages SAS drives
  • This exact scenario happens frequently when drives are moved between controllers
  • Until tested on a DIF-capable HBA, there is no evidence of permanent failure

If you cannot access a T10-capable controller, the drive may remain unusable on that system, but still be perfectly recoverable elsewhere.

A case of a user with another problem but where he needed to disable DIF, got it fixed after a new format with these parameters (from Google):

https://www.truenas.com/community/threads/drives-formatted-with-type-1-protection-eventually-lead-to-data-loss.86007/

load more comments (9 replies)
[–] jerkface@lemmy.ca 29 points 3 days ago* (last edited 3 days ago) (1 children)

There are so many things wrong here, people don't even have the bandwidth to complain about how the blurry, off-angle, fucking ROTATED photos of a screen contribute to this absolute dumpster fire of a post. Just trying to do my part.

[–] qaz@lemmy.world 6 points 2 days ago (1 children)

Don't forget about the glare

[–] jerkface@lemmy.ca 2 points 2 days ago

Thank you, I did forget the glare.

[–] rtxn@lemmy.world 70 points 3 days ago

@Mods, please don't delete this. It's a valuable lesson.

[–] kingofras@lemmy.world 70 points 3 days ago (2 children)

It’s really next to impossible to read that and not clown on you, so I’ll just print these out and hang them in the server room next to the no cats or drinks signs.

load more comments (2 replies)
[–] Greg@lemmy.ca 64 points 3 days ago* (last edited 3 days ago) (4 children)

I'm confident this is recoverable. Can you throw the failing drive into a USB enclosure? It might be easier to reformat the drive in the OS you're most familiar with.

And don't feel bad about breaking things, that's the best way to learn! I've been breaking things long before ChatGPT came along.

[–] irmadlad@lemmy.world 11 points 3 days ago

And don’t feel bad about breaking things, that’s the best way to learn

Most of what I know, which is not a a huge repository of intellect, I learned thusly:

  • Read ---> try--->fuck it up #$%^^
  • re-read ---> try again--->fuck it up once more #$%^^
  • $$@#!!! more reading ---> more trying --->That WORKED! Write that shit down!
[–] rook@lemmy.zip 4 points 2 days ago (1 children)

Thanks for the uplifting words

I've connected to drive to another PC running Linux Mint 22, and the disks app can see the drive but no actions can be done on it. And Gparted can't even read it lol.

Any ideas?

[–] Greg@lemmy.ca 3 points 2 days ago (1 children)

How do you have the SAS drive connected to your Mint 22 box (what exact adapter/controller)? Is it going through a real SAS HBA (LSI/Broadcom-style, IT/HBA mode), or through a RAID controller / USB-SAS bridge / "virtual" adapter?

Reason I’m asking: there are basically two connection paths:

  • True HBA/passthrough: Linux gets direct SCSI access (you’ll see a /dev/sgX for the disk) and you can usually low-level reformat it back to 512-byte logical blocks (e.g., from 520/528).
  • RAID/USB/translation layer: the controller hides or emulates the SCSI commands, so tools like sg_format often can’t issue the low-level format needed to switch the sector size. That might be why the disk is visible in the disks app but not in gparted.

Given the screen shots I believe it's the later. Can someone smarter than me confirm?

[–] rook@lemmy.zip 3 points 2 days ago* (last edited 2 days ago)

Thanks for the reply,

It is an LSI card, the same one that was in my truenas server.

This one bought here

Edit: also the command that bricked the drive was me using sg_format with --size==512

Is that the same formatting solution you were mentioning ? Is it different?

load more comments (2 replies)
[–] entropicdrift@lemmy.sdf.org 54 points 3 days ago* (last edited 3 days ago) (1 children)

Don't trust AI to know what they're doing for you. The only time they work reliably as a tool is when you already know what you're doing enough to spot their errors/hallucinations.

AI is the wrong tool here. You need to do real internet research.

[–] scrubbles@poptalk.scrubbles.tech 13 points 3 days ago (2 children)

Exactly this. People here mass downvote but I personally find AI to be extremely useful... To do things I already know how to do but don't have the time for. I don't trust it to do things I can't spot the errors in

load more comments (2 replies)
[–] xxce2AAb@feddit.dk 42 points 3 days ago (1 children)
[–] N0x0n@lemmy.ml 13 points 3 days ago (1 children)

All together: Don't blindy copy/past from the internet OR from AI !

load more comments (1 replies)

Per this forum post, you might just need to reboot. This was the first link that came up when I searched for your error. In the future, turn to documentation and the forums/support for the software rather than a dumb text generator.

[–] possiblylinux127@lemmy.zip 21 points 3 days ago

I would strongly recommend against using AI

[–] fodor@lemmy.zip 20 points 3 days ago

Oh dear God, what were you thinking? Why did you turn to chatgbt knowing that you could have actually found a website that told you what to do correctly written by someone who actually did it before?

[–] nutbutter@discuss.tchncs.de 18 points 3 days ago (6 children)

Why do you trust a text generator for critical things? And did you really not cross check what command it is asking you to run?

Anyway, the solution...

If I were you I would plug the drive into a system where I can run gparted or KDE Partition Manager, with a GUI and try to format the drive again, create the partition table again. If you have tried that, what errors are you getting?

load more comments (6 replies)
[–] PushButton@lemmy.world 5 points 2 days ago

You should have clicked on the "get smarter responses" button...

Sorry, I couldn't resist. I am going now, good luck.

ᕕ(ᐛ)ᕗ

[–] PhobosAnomaly@feddit.uk 15 points 3 days ago* (last edited 3 days ago)

Sorry friend.

If your data was occupationally-sensitive or renders you vulnerable to financial ruination, it's time to move to a recovery phase and see if modern data recovery specialists can work their voodoo.

Remember: never run experimental commands (you or a GenAI) in a live environment. See how it breaks things in a test environment first - if it shits itself, you may even get to learn how to fix it before running the instruction on live data.

Anecdote time! A good friend of mine drove his car to a mutual colleague's place once because the wipers were about as much use as two chicken breasts on metal poles. He says to our colleague "Hey Foxy, I hear you're good with cars, can you fix these wipers for me? The rubber seems to be in good nick but it's not clearing anything".

"Sure thing," Foxy proudly announces, "I'll get to work".

Foxy strips the wipers down, one component at a time, before dusting his hands off and walking away.

"What's going on, Foxy? The thing's still in bits!" my pal says.

"No idea," says Foxy, "not a fucking Scooby mate" and goes back inside, leaving his wipers and actuating motor in about fourteen pieces on the roadside.

So much for being good with cars.

[–] Skyline969@lemmy.ca 15 points 3 days ago

AI strikes again.

load more comments
view more: next ›