You are not logged in.
Pages: 1
I've a laptop with a 1Tb primary hard disk and a 120 Gb secondary hard disk where I used to save personal files during the migration to linux.
I had installed archlinux and everything worked correctly but yesterday I've tried to install a dualboot of arch and fedora (I was going to test even that distro).
However, after installation fedora didn't appear in the initial grub, so I've decide to reinstall the grub with the command
sudo grub-install /dev/sda
Here the problems began. I've accidentally installed grub on my secondary hard-disk partition and now I can’t access anymore to that disk.
This is the error message:
Error mounting /dev/sda2 at /run/media/gim/Disco locale: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error
Someone can help me?? Please I had important documents on that partition. I’m desperate to find a solution
I've list the partitions with fdisk -l and this are the information about that partition:
Disk /dev/sda: 119,24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: SAMSUNG MZNLN128
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x938468f3
Dispositivo Avvio Start Fine Settori Size Id Tipo
/dev/sda1 2048 8194047 8192000 3,9G c W95 FAT32 (LBA)
/dev/sda2 8194048 250064895 241870848 115,3G 7 HPFS/NTFS/exFAT
Last edited by Gim00 (2024-07-31 23:28:08)
Offline
Why do you label the 120 GB SSD your "secondary" disk even when linux enumerates it as the first disk (sda)?
Why do you try to install grub to your "secondary" disk - does that make sense to you?
What is your default grub target? Run
grub-install --help
and look for the default under the "--target" option.
Did you do
sudo grub-install /dev/sda2
too or why do you think you accidentally installed grub in this partition?
What is the partition layout on your 1TB drive?
What is your boot mode (BIOS/CSM or EFI)?
Offline
Why do you label the 120 GB SSD your "secondary" disk even when linux enumerates it as the first disk (sda)?
Why do you try to install grub to your "secondary" disk - does that make sense to you?
What is your default grub target? Rungrub-install --help
and look for the default under the "--target" option.
Did you dosudo grub-install /dev/sda2
too or why do you think you accidentally installed grub in this partition?
What is the partition layout on your 1TB drive?
What is your boot mode (BIOS/CSM or EFI)?
Hi, thanks for the answer.
The default target is "x86_64-efi"
Anyway, idk why my sda is the secondary disk and sdb is the primary, but was a fault install grub on sda and now I don't know how to solve this situation and restore my file...
I've done both
sudo grub-install /dev/sda
and
sudo grub-install /dev/sda2
The 1Tb drive is the SDB partition and is the one where there's installed linux now and before windows (yes i've just switched from Windows so sorry if I'll commit some errors)
I think my laptop's bootmode is bios (when i reboot it says "press F12 for Bios")
Last edited by Gim00 (2024-07-31 14:38:52)
Offline
Please post the output of
sudo fdisk -l /dev/sdb
cat /sys/firmware/efi/fw_platform_size
If the output of the second command is empty, please mention it.
Just to prevent misunderstandings:
Whole disks:
/dev/sda
/dev/sdb
...
Partitions:
/dev/sda1
/dev/sda2
/dev/sda3
...
/dev/sdb1
...
Offline
Over-writing the MBR should not have affected the data partition. Not sure if GRUB will use the i386-pc target automatically if booted in non-UEFI mode though.
@OP:
Did the grub-install command return any error messages?
In which context do you see the /dev/sda2 error message?
A full journal from that boot would probably be useful for us.
Para todos todo, para nosotros nada
Offline
Please post the output of
sudo fdisk -l /dev/sdb cat /sys/firmware/efi/fw_platform_size
If the output of the second command is empty, please mention it.
Just to prevent misunderstandings:
Whole disks: /dev/sda /dev/sdb ... Partitions: /dev/sda1 /dev/sda2 /dev/sda3 ... /dev/sdb1 ...
The output of the second command is:
cat /sys/firmware/efi/fw_platform_size
File: /sys/firmware/efi/fw_platform_size
64
Offline
Over-writing the MBR should not have affected the data partition. Not sure if GRUB will use the i386-pc target automatically if booted in non-UEFI mode though.
@OP:
Did the grub-install command return any error messages?
In which context do you see the /dev/sda2 error message?
A full journal from that boot would probably be useful for us.
No, the grub install do not report any error.
The error message appear when I try to open sda2 with File manager.
How can I produce the journal? Sorry for the stupid question
Offline
How can I produce the journal?
Run this command:
journalctl -b 0 | curl -F 'file=@-' 0x0.st
Then post the returned URL here.
You are booted in UEFI mode so the grub-install command would have just installed the modules to /boot/grub/ and core.img to /boot/efi/EFI/arch/grubx64.efi.
Please share the output of
lsblk -f
And `fdisk -l /dev/sdb`, as requested by -thc.
Para todos todo, para nosotros nada
Offline
You have a system running in 64-bit EFI mode.
The "grub-install" commands you entered should not work and should do no harm.
@Head_on_a_Stick: Is "/boot/efi" the default for grub-install?
Last edited by -thc (2024-07-31 19:18:27)
Offline
Is "/boot/efi" the default for grub-install?
I think so, yes. Unless it's changed recently ofc.
Para todos todo, para nosotros nada
Offline
Gim00 wrote:How can I produce the journal?
Run this command:
journalctl -b 0 | curl -F 'file=@-' 0x0.st
Then post the returned URL here.
You are booted in UEFI mode so the grub-install command would have just installed the modules to /boot/grub/ and core.img to /boot/efi/EFI/arch/grubx64.efi.
Please share the output of
lsblk -f
And `fdisk -l /dev/sdb`, as requested by -thc.
Thank you very much for the help.
The journal url is: http://0x0.st/XOcQ.txt
Output of lsblk -f is:
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0 0 100% /var/lib/snapd/snap/bare/5
loop1 0 100% /var/lib/snapd/snap/gnome-3-28-1804/198
loop2 0 100% /var/lib/snapd/snap/core18/2829
loop3 0 100% /var/lib/snapd/snap/snapd/21759
loop4 0 100% /var/lib/snapd/snap/utorrent/102
loop5 0 100% /var/lib/snapd/snap/whatsapp-linux-app/2
loop6 0 100% /var/lib/snapd/snap/core20/2318
loop7 0 100% /var/lib/snapd/snap/gtk-common-themes/1535
loop8 0 100% /var/lib/snapd/snap/wine-platform-runtime/381
loop9 0 100% /var/lib/snapd/snap/wine-platform-6-stable/19
loop10 0 100% /var/lib/snapd/snap/wine-platform-runtime/382
sda
├─sda1 vfat FAT32 HPDOCS 48FC-92BA 3,7G 6% /run/media/gim/HPDOCS
└─sda2 ntfs Disco locale EABE0B7BBE0B3F95
sdb
├─sdb1 vfat FAT32 6028-D5AC 298,8M 0% /boot/efi
├─sdb2 btrfs b426b508-ccb2-4cec-854c-659388b42c3f 22,1G 93% /var/log
│ /var/cache
│ /root
│ /home
│ /var/tmp
│ /srv
│ /
├─sdb3 btrfs 46dea10b-5c8e-4d2a-ba57-115079999831
└─sdb4 vfat FAT32 E86B-1168
zram0 [SWAP]
Output of fdisk -l /dev/sdb is:
Disk /dev/sdb: 931,51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10SPZX-60Z
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3E7020D5-ECFA-4885-9244-21757709CD73
Dispositivo Start Fine Settori Size Tipo
/dev/sdb1 4096 618495 614400 300M EFI System
/dev/sdb2 618496 724719615 724101120 345,3G Linux filesystem
/dev/sdb3 724719616 1134323711 409604096 195,3G EFI System
/dev/sdb4 1134323712 1134938111 614400 300M EFI System
sdb3 and sdb4 is where i've installed Fedora.
Last edited by Gim00 (2024-07-31 19:52:37)
Offline
I can’t really understand why it doesn’t make me access this disk anymore...
There's any chance to recovery it?
Offline
Well that Fedora system isn't right, the root partition has an ESP GUID and it has it's own ESP as well. Not really relevant here though.
From the journal:
lug 31 18:07:23 Parsifal kernel: ntfs3: sda2: It is recommened to use chkdsk.
lug 31 18:07:23 Parsifal kernel: ntfs3: sda2: volume is dirty and "force" flag is not set!
lug 31 18:07:26 Parsifal kernel: ntfs3: sda2: It is recommened to use chkdsk.
lug 31 18:07:26 Parsifal kernel: ntfs3: sda2: volume is dirty and "force" flag is not set!
lug 31 18:07:28 Parsifal kernel: ntfs3: sda2: It is recommened to use chkdsk.
lug 31 18:07:28 Parsifal kernel: ntfs3: sda2: volume is dirty and "force" flag is not set!
lug 31 18:07:42 Parsifal kernel: ntfs3: sda2: It is recommened to use chkdsk.
lug 31 18:07:42 Parsifal kernel: ntfs3: sda2: volume is dirty and "force" flag is not set!
lug 31 18:07:42 Parsifal kernel: ntfs3: sda2: It is recommened to use chkdsk.
lug 31 18:07:42 Parsifal kernel: ntfs3: sda2: volume is dirty and "force" flag is not set!
lug 31 18:07:43 Parsifal kernel: ntfs3: sda2: It is recommened to use chkdsk.
lug 31 18:07:43 Parsifal kernel: ntfs3: sda2: volume is dirty and "force" flag is not set!
lug 31 18:07:43 Parsifal wpa_supplicant[927]: wlo1: SME: Trying to authenticate with 54:46:17:c2:5c:a9 (SSID='Wind3 HUB - C25CA8' freq=5260 MHz)
lug 31 18:07:43 Parsifal kernel: wlo1: disconnect from AP 54:46:17:c2:5c:a8 for new auth to 54:46:17:c2:5c:a9
lug 31 18:07:43 Parsifal kernel: ntfs3: sda2: It is recommened to use chkdsk.
lug 31 18:07:43 Parsifal kernel: ntfs3: sda2: volume is dirty and "force" flag is not set!
Para todos todo, para nosotros nada
Offline
I'm sorry - I can't help you - too much chaos for me.
If only the NTFS dirty flag is set a simple
ntfsfix /dev/sda2
should probably help.
Last edited by -thc (2024-07-31 20:04:57)
Offline
Anyway, idk why my sda is the secondary disk and sdb is the primary
The enumeration isn't deterministic why you're supposed to use UUIDs
For the bigger picture, why is there an NTFS partition, but no windows?
Do you have a 3rd disk w/ windows on it?
Fixing ntfs w/ chkdsk (windows tool) is preferable over ntfsfix, esp. if you've important data on it.
It'd probably even be a good idea to create a backup image of the damaged disk to have a homebase if you screw things up even more.
Offline
Anyway, idk why my sda is the secondary disk and sdb is the primary
The enumeration isn't deterministic why you're supposed to use UUIDs
For the bigger picture, why is there an NTFS partition, but no windows?
Do you have a 3rd disk w/ windows on it?Fixing ntfs w/ chkdsk (windows tool) is preferable over ntfsfix, esp. if you've important data on it.
It'd probably even be a good idea to create a backup image of the damaged disk to have a homebase if you screw things up even more.
Until a couple of weeks ago I had windows, then I've installed Arch Linux. When I've done the migration I've copy all important files in sda and installed linux on sdb. Maybe for this reason it is NTFS.
Anyway, how can I do the command chkdks? I've wrote it in the terminal but it says that the command wasn't found.
I've done even the command ntfsfix but it hasn't worked for me.
Thanks in advance.
Last edited by Gim00 (2024-07-31 21:39:52)
Offline
Fixing ntfs w/ chkdsk (windows tool) is preferable over ntfsfix
it hasn't worked for me.
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Did you get some error?
In doubt see https://wiki.archlinux.org/title/NTFS#U … rked_dirty
nb. that the FS is marked dirty for a reason, and just clearing the flag might cause data loss.
Try to mount it read-only w/ https://wiki.archlinux.org/title/NTFS-3G and ensure to access/secure all relevant data first.
If you've access to a windows installation, use that to chkdsk it.
Then migrate away from NTFS, it's no a first-class FS on linux (reverse engineered and feature incomplete, regardless of the driver) and there's no point or reason to use it if you don't have frequent access to windows.
Offline
When I do ntfsfix command the output is:
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sda2 was processed successfully.
Why it says that the mounting volume is OK but it doesn't opening?
Offline
ntfsfix is part of ntfs-3g which is way more lenient reg. the dirty bit.
You're gonna be able to mount the partition using ntfs-3g.
Offline
ntfsfix is part of ntfs-3g which is way more lenient reg. the dirty bit.
You're gonna be able to mount the partition using ntfs-3g.
Finnally I solve with the command:
ntfs-3g /dev/
Thanks everyone for the help. I'm so grateful
Offline
You can remove the dirty bit w/ "ntfsfix --clear-dirty", see the previous link, but you should *really* seek to chkdsk the partition and/or transfer your data to a FS you can actually properly maintain.
Offline
Pages: 1