44
submitted 1 year ago* (last edited 1 year ago) by bec@lemmy.ml to c/linux@lemmy.ml

I was playing a game, alt-tabbing froze my system so I waited a bit and then rebooted by using the button on the case, since I couldn't do differently.

It now throws an error when mounting a drive: error mounting /dev/sdb1 at /media/user/local disk 1: unknown error when mounting (udisks-error-quark, 0)

This drive doesn't have anything I was using on it, since it's a media storage drive. I booted up Windows on my second drive and it can see and access this one without problems. How to fix?

top 37 comments
sorted by: hot top controversial new old
[-] SomethingBurger@jlai.lu 24 points 1 year ago

What filesystem is on the disk? If it's NTFS, you'll need to fix it on Windows (right click, Properties, Tools, Check).

[-] bec@lemmy.ml 10 points 1 year ago

It worked, thanks a lot! What would be the Linux alternative to do that?

[-] Atemu@lemmy.ml 25 points 1 year ago

There is none. NTFS is a filesystem you should only use if you need Windows compatibility anyways. Eventhough Linux natively supports it these days, it's still primarily a windows filesystem.

[-] bec@lemmy.ml 8 points 1 year ago

Oh, I see. So you're saying that, when I have the chance, I should move to a different filesysten and that would avoid me issues as the one in the OP?

[-] Atemu@lemmy.ml 9 points 1 year ago

If you're only using this filesystem on Linux anyways, absolutely.

[-] bec@lemmy.ml 2 points 1 year ago

Yes, I've basically moved permanently over to Linux and do 99.9% of the things on it. Had to boot Windows for the first time in days only to check whether or not my HDD died after I couldn't mount it

I'm still in the process of optimizing stuff around Linux (e.g. media drive filesystem) but I'll get there haha

[-] Atemu@lemmy.ml 2 points 1 year ago

I’m still in the process of optimizing stuff around Linux (e.g. media drive filesystem)

What do you mean by that?

[-] possiblylinux127@lemmy.zip 2 points 1 year ago

You could use btrfs on Linux and install the windows driver. The Windows driver isn't what I would call stable but it will work if your mostly using Windows.

Another option is a windows virtual machine instead of dual booting. With a VM you could simple transfer files with magic wormhole or something similar

[-] bec@lemmy.ml 1 points 1 year ago

Nah, all Linux is good. I don't really need to use Win and since all my HDDs are for media storage I have no reason not to use them on Linux only. They're only mine and don't have to hop from PC to PC. Thanks for the input though

[-] Atemu@lemmy.ml 1 points 1 year ago

From what I've seen, that's a great way to corrupt your filesystem.

[-] db2@sopuli.xyz 1 points 1 year ago* (last edited 1 year ago)

FAT is older and has fewer features but it's better supported.

[-] woelkchen@lemmy.world 6 points 1 year ago

exFAT, not old school regular FAT.

[-] db2@sopuli.xyz 0 points 1 year ago
[-] bec@lemmy.ml 2 points 1 year ago

I tried formatting an external HDD and I picked FAT, I'll have to research whether or not that filesystem is good for my needs

[-] SomethingBurger@jlai.lu 10 points 1 year ago

ntfsfix but in my experience it doesn't really work if it can't mount the drive in the first place.

[-] bec@lemmy.ml 2 points 1 year ago

Guess I'll need to keep W10 around haha thanks again

[-] ReversalHatchery@beehaw.org 6 points 1 year ago

If otherwise you don't plan to use windows on that machine anymore (on bare metal, a virtual machine is not relevant here), it would be better to transfer your data to a Linux native file system. Unless you have a solid preference, ext4 is a good choice.

Basically you just need to copy your files over, but you may need to do it in chunks (and resize the 2 partitions in every round) if you can't hold the files if the NTFS file system safely while you reformat it.
Also, if you want to keep attributes like file creation time and last modification time, that'll require a bit more copy parameters, if you want this let me know and I'll fill you in on the details.
What distro do you use by the way?

[-] bec@lemmy.ml 1 points 1 year ago

I'll keep it in mind, but since I'm getting new, bigger drives I think I'll just wait for and format them directly in the better filesystem. I tried formatting an external HDD and I think I could only pick FAT or NTSC (I'll double check), hopefully on the internal drives it will be different!

I'm on Pop!

[-] SteveTech@programming.dev 2 points 1 year ago* (last edited 1 year ago)

If you're using gnome disks, it hides the more Linuxy file systems behind an 'Other' option.

Personally, for removable drives I prefer to use

  • ext4 for HDDs
  • f2fs for SSDs
  • exfat for Windows compatibility

If it's grayed out or you're getting errors try searching up 'how to format as [file system] in [Pop OS/Ubuntu/Linux]', you might need some extra packages.

[-] bec@lemmy.ml 1 points 1 year ago* (last edited 1 year ago)

Yeah, most options were greyed out. I'll have to visit the wiki of my distro haha thanks for the tips though

edit: actually, just checked, EXT4 isn't greyed out, but it says "internal disk for use with Linux only" and since it's an external/portable HDD I didn't pick that option

[-] SteveTech@programming.dev 4 points 1 year ago

I'm pretty sure there's no difference between internal and external ext4 (at least how gnome disks handles it), so I think it's just trying to make sure users don't freak out when they format it as ext4 and think their data is all gone on Windows.

Also when it's grayed out you usually just have to install the fuse driver and file system tools, IIRC for exfat you install exfat-fuse and exfatprogs.

[-] allywilson@sopuli.xyz 4 points 1 year ago

Can you reformat that drive as exFAT? That should remove NTFS as being a reason to keep Windoze around (and even if you do need Windoze, it should be able to read that format fine as well).

[-] bec@lemmy.ml 1 points 1 year ago

Yes, I just learned I can use a different filesystem to avoid (or at least minimize) these issues in future. I tried formatting a portable HDD and I could only pick FAT, that should be OK since I picked "Linux compatibility" or something like that in the format wizard!

[-] FalseDiamond@sh.itjust.works 3 points 1 year ago

If it's just the dirty flag (it was uncleanly unmounted) you can try

ntfsfix -d /dev/sdc1

Still probably better to boot into Windows and let it deal with it (ntfs tools are still reverse engineered stuff after all), and check journalctl before doing it, but it works in a pinch.

[-] bec@lemmy.ml 5 points 1 year ago

It is, thanks I'll try that!

[-] kylian0087@lemmy.world 23 points 1 year ago* (last edited 1 year ago)

Tip for when you need to use the power button and do a force shutdown. Try the following first Alt+SysRq r>e>i>s>u>b

https://blog.kember.net/posts/2008-04-reisub-the-gentle-linux-restart/

[-] SomethingBurger@jlai.lu 17 points 1 year ago

Raising Elephants Is So Utterly Boring

[-] MimicJar@lemmy.world 6 points 1 year ago

I always preferred BUSIER backwards. It's shorter and alliterative., but whatever helps you remember.

[-] turbowafflz@lemmy.world 12 points 1 year ago

Annoyingly sysrq is disabled on a lot of distributions by default now, so you often have to manually enable it for this to work

[-] kylian0087@lemmy.world 2 points 1 year ago

It is? I never noticed it being disabled honestly.

[-] turbowafflz@lemmy.world 2 points 1 year ago

At least arch and opensuse do, I haven't used anything else much lately

[-] kylian0087@lemmy.world 4 points 1 year ago

Those are exactly the ones i never noticed sysrq being disabled. I use the resisub quite often on tumblweed. and used to on arch.

[-] ElderWendigo@sh.itjust.works 3 points 1 year ago

I've always just dropped down into a different virtual terminal with CTRL+ALT+F#, killed the bad process and/or just rebooted from there. Is that not a thing anymore? I haven't had to do it in so long because of improved stability and not using the DE on my server much, so maybe I'm out of the loop.

[-] SomethingBurger@jlai.lu 6 points 1 year ago

Sometimes it's not possible if everything crashed.

[-] bec@lemmy.ml 3 points 1 year ago

That's very useful, I'll try it next time, thanks for the tip!

[-] taanegl@beehaw.org 0 points 1 year ago* (last edited 1 year ago)

Firstly, check the logs directly to get a more concise error that we can analyse. journalctl is the standard systemd logging client you can use in the terminal. By specifying the unit (units can be socket files, timers, services) you can get logs specifically for said unit.

journalctl -u udisks2.service

You can also specify binary, if said binary logs to journalctl, like so (if the binary path exists):

journalctl /usr/lib/udisks2/udisksd

You can also check kernel messages (dmesg) by using the -k flag, like so:

journalctl -k

You can utelize flags such as -e to scroll to the end of a journal, -f to follow a journal in realtime and utelize the -p flag to set priorities like error, crit, warning (-o error) and others to filter away common journal entries so you don't have to scroll through every line in the log.

Secondly, and this is gonna sound weird, but reboot into windows twice. The first time you boot windows run diskchk on the partition(s) in terminal/powershell/command as administrator. If it tells you it needs to do an offline scan, reboot and you'll see an offline diskchk screen on boot before login. If not, reboot again into windows anyways, and then reboot into Linux.

The reason is that NTFS has a weird failsafe flag that NTFS on Linux considers a no-go, and it's usually set if the system crashes more than twice, but not always. If Linux NTFS drivers see the flag, it won't mount as a precaution. The only way to reset the flag is to reboot in windows twice. Not once, not three times, but twice.

This might be outdated info, but that was the fact some years ago. There might be a way to fix it with modern day Linux, but I don't know, especially when I have no direct and informative errors to go by.

journalctl is your friend :)

this post was submitted on 08 Nov 2023
44 points (90.7% liked)

Linux

48224 readers
581 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS