r/debian • u/maria08042009 • 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).
1
u/CardOk755 4d ago
Do you have a filesystem on /dev/sda2. What type of filesystem? Is it broken?
What does the dmesg log say?
1
u/maria08042009 4d ago
basicaly from my perspestive it's a harddisk in ps itself (not USB-drive)
and I'll have to try and find dmesg log
1
u/CardOk755 4d ago
sudo dmesg > my-log
Then look in my-log for messages referring to sda2
2
u/maria08042009 4d ago
I think it's this
[ 31.608360] ntfs3(sda2): It is recommened to use chkdsk.
[ 31.655606] ntfs3(sda2): volume is dirty and "force" flag is not set!
1
u/maria08042009 4d ago
[ 31.608360] ntfs3(sda2): It is recommened to use chkdsk.
[ 31.655606] ntfs3(sda2): volume is dirty and "force" flag is not set!
1
u/maria08042009 4d ago
dmesg --level=err
[ 0.070052] x86/cpu: SGX disabled or unsupported by BIOS.
[ 3.248802] i915 0000:00:02.0: [drm] *ERROR* Failed to probe lspcon
[ 6.783259] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761bu_fw not found
0
u/maria08042009 4d ago
I don't know... I am a really casual user, so I have no idea
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/CardOk755 4d ago
Ow. Looks like you got rid of Windows too soon. You should have copied all the data you wanted to save to somewhere safe first.
Just how much important data is on that partition?
1
u/maria08042009 4d ago
It's mostly pictures and few kinda personal docs, so it'd be really sad to lose them, but nothing that would cause long-trem damage, I think.
1
u/maria08042009 4d ago
And I had just Debian system from last February, and hadn't had any problems like this... Probably it's connected with the fact that my UPS stopped working (I live in Ukraine, situation with electricity is not pretty. I didn't have electricity from 7am Oct. 9 to 6:40 am Oct. 10).
1
u/CardOk755 4d ago
Oh, it's certainly due to the unclean shutdown.
If you can't use Windows then try ntfsprogs, https://manpages.debian.org/trixie/ntfs-3g/ntfsprogs.8.en.html
ntfsls to list the files in the partition and ntfscat to copy them from the partition to a Linux partition.
When you are sure you have all the data you want you can reformat the partition for Linux.
2
u/maria08042009 4d ago
Thanks! I think it can wait a till Monday-Tuesday, because I should have a working UPS by then (I really don't want to risk it, situation with electricity is very unstable).
1
u/CardOk755 4d ago
By the way, all the ntfsxxx programs (like ntfsls and ntfscat) from ntfsprogs are part of the ntfs-3g package, which I think you have installed.
1
u/KlePu 3d 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.
ddcan copy block data directly, you can then redirect that data to a file:
- find a place that has enough space:
df -hto get/path/to/place/with/space/(this is a read only command, cannot do any harm)- check the path of your NTFS disk:
lsblk -fto 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
1
u/maria08042009 4d ago
Is it possible to copy files from this disk beforehand?
1
u/CardOk755 4d ago
From that partition? You could look into the ntfsprogs package, that might let you list and copy files from the partition.
I have no idea whether it's safe. I'm nowhere near an expert on NTFS.
Personally, I'd use Windows to fix it then copy all the important files off to a Linux partition.
What important data dies it contain?
1
u/billdietrich1 4d ago
Please use better, more informative, titles (subject-lines) on your posts. Give specifics right in the title. Thanks.
3
1
u/Symantech 4d ago
I had the same problem with my external ntfs drive. I checked the filesystem and got it repaired, that's all (I did it on Windows just to be sure)
2
u/anto77_butt_kinkier 3d ago
This is a classic windows error. You need to disable fast-boot and hibernation, boot into Linux, then check & repair the filesystem. Then you should be able to access it. Windows likes to leave drives in a "dirty" state, because... Why not, I guess.
1
1
u/elivoncoder 3d ago
I had a recent issue where bios reset to default, causing disk to goto raid instead of ahci. just a thought.


2
u/Dolapevich 3d ago
Instead of asking too many questions, can you please run a linux-hardware probe so we can see what is your hardware disks etc?
Most likely the partition /dev/sda2 is using ntfs, and marked a "dirty", so linux is refusing to mount it to avoid further damage to it.
You should run
chkdskin a windows machine.