r/debian • • 4d ago

Help!

I can't open one of disks on my PC, I don't know what to do. I'm not sure what could have done this. Last time I turned on PC everything was fine. Do you think the fact that PC went without electricity for nearly 24 hours? I wasn't able tot turn it off properly because of my UPS no longer working properly.

Update: I managed to copy all my data to a different disk. Problem was caused by one .odt file that was saved incorrectly due emergency incorrect shutdown of PC (thanks to my broken UPS).

21 Upvotes

31 comments sorted by

View all comments

Show parent comments

1

u/CardOk755 4d ago

Mods removed your dmesg, don't know why, but:

Aha, you have a Microsoft NTFS filesystem on /dev/sda2 and it was uncleanly unmounted.

Historically Linux has been really bad at fixing problems on NTFS filesystems. I'd recommend trying to mount that disk on a windows system.

(I might be out of date, I haven't messed with NTFS in years).

1

u/maria08042009 4d ago

how should I do that? it's not a disk I can just take out of PC (it's inside the PC, basicaly tome D, but not exactly). and my PC is fully Debian. should I try virtualbox Windows (how t odo that too...)?

1

u/KlePu 4d ago

Removing a drive from a PC is not hard at all. Obviously unplug power/remove battery first ;)

Tower PC: get a screwdriver, remove two screws on the rear left to remove the left panel. Then google your disk to see what it looks like; "normal" SSDs are about the size or a pack of cigarettes, NVMe are way smaller, like your thumb but flat.

Laptop: depends on model, but there's video guides for pretty much every model nowadays.

Then, get a USB enclosure for a few bucks and see a friend who runs Windows ;)

2

u/maria08042009 3d ago

Thanks, that's probably going to be last resort, but useful to know nevertheless.

1

u/KlePu 3d ago edited 3d ago

Whatever you do, try to use read-only mode when accessing the troubled disk until you got a clean copy of all the data. If you do have a disk with enough free space, you could try to create a 1:1 copy and only work on that. dd can copy block data directly, you can then redirect that data to a file:

  • find a place that has enough space: df -h to get /path/to/place/with/space/ (this is a read only command, cannot do any harm)
  • check the path of your NTFS disk: lsblk -f to get /dev/sdX (this is read only as well)
  • then create the actual image: sudo dd if=/dev/sdX of="/path/to/place/with/space/my-data.img" bs=4M conv=noerror,sync status=progress && sync (this can destroy all of your data if used incorrectly ;-p)

edit: mixed up my variables, sorry <.<

If you do want to try this, I can give more detailed instructions ;)

2

u/CardOk755 3d ago

df only works on mounted filesystems.

1

u/KlePu 3d ago

Yep, mixed up the outputs. Corrected ;)