Other Mount error

I'm getting a mount error:-

mount: /mnt: wrong fs type, bad option, bad superblock, on /dev/sda2, missing codepage or helper program or other error.

I'm doing this on archlinux which I want to install, but wondered if I might be able to identify any of these errors if I tried to mount the same partition which is a 20GB extfs4 partition on a 1TB GPT USB disk if I tried to mount it from FreeBSD.
 
this is how I mount my Linux drives/partitions/slices on FreeBSD using a script.

Code:
sudo mount -t ext2fs /dev/nvd0p10 /media/data
sudo mount -t ext2fs /dev/nvd0p12 /media/projects
sudo mount -t ext2fs /dev/ada0p1 /media/storage
On FreeBSD mount -t ext2fs /dev/da1p2 :-
Code:
ext2fs: da1p2: wrong magic number 0 (expected 0xef53)
mount: /dev/da1p2: invalid argument
 
Please show the output of file -s /dev/da1p2.
Code:
 gpart show da1
=>        40  1953525088  da1  GPT  (932G)
          40        2008       - free -  (1.0M)
        2048     1048576    1  linux-data  (512M)
     1050624    19531776    2  linux-data  (9.3G)
    20582400  1932942728       - free -  (922G)

file -s /dev/da1p2
/dev/da1p2: data

I just tried running :-
mke2fs /dev/da1p2

and now get:
Code:
file -s /dev/da1p2
/dev/da1p2: Linux rev 1.0 ext2 filesystem data, UUID=7452d046-7b51-4c76-9fc0-a3dfab02cb0f (large files)

Looks like the partition didn't get formatted properly on Linux.
 
giving what SirSLice said, you'd probally what to boot a linux usb stick if you don't have linux on that system then check all of your what's in question to figure out what is what then start over again after you sort everything out.
 
giving what SirSLice said, you'd probally what to boot a linux usb stick if you don't have linux on that system then check all of your what's in question to figure out what is what then start over again after you sort everything out.
I was actually trying to install Linux from an ISO img but it looks like I must have messed up the partitioning/formatting. The only reason I'm trying to install Linux is so that I have a working GRUB setup.

When trying again, I get

Code:
Error fsyncing/closing /dev/sda2: Remote I/O error

Is this some indication of a hardware fault?
 
I was actually trying to install Linux from an ISO img but it looks like I must have messed up the partitioning/formatting. The only reason I'm trying to install Linux is so that I have a working GRUB setup.

When trying again, I get

Code:
Error fsyncing/closing /dev/sda2: Remote I/O error

Is this some indication of a hardware fault?
that is off a live iso linux distro?
I don't know what that is, I never seen that error before trying to install off a usb stick. remote i/o error to me would indicate over a "wire" install.

I hope you have one that has gparted in it. You can use that to make a small partition and install everything into / (root) . and use it to check the partition(s).

smart : check hdds
 
The only reason I'm trying to install Linux is so that I have a working GRUB setup.
My knowledge from the past is that after some stage of booting grub requires data from the Linux partition for the next steps of booting. When you delete the Linux partition the Linux based grub will stop working. This information might be wrong because it is from the past.
 
Yes, grub lives in a partition (not in a bootloader or header), so if you destroy what grub names the root partition grub stops working.

Note that what grub calls "root" partition is usually what the Linux install will call /boot, or it might not even be used by the Linux install at all.
 
get the most minimalist Linux, void Linux is a bare bones OS ( 700MB ) without a desktop GUI stuff like FreeBSD, but the install is not too hard, depending on the persons apatutue. just create the smallest partition for Linux and install it putting everything into /

meaning don't split up your / and /home or other directories. that part is no different then installing FreeBSD other than naming schema. put everything on / (root)


grub installs on this little part of the hdd you don't tell it a partition but the drive you want it installed on. /dev/sda /dev/sdb etc..

everything goes in /
Code:
$> ls /
bin        lib        new-os        sbin        var
boot        lib64        opt        srv
dev        lost+found    proc        sys
etc        media        root        tmp
home        mnt        run        usr
then in /etc/grub.d/40_custom
Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


menuentry "FreeBSD 13.2" {
      insmod ufs2
      root=(hd1,gpt5)
      chainloader /boot/loader.efi
}
where which hd, then partition freebsd is installed on. It is zero based. FYI
 
I was actually trying to install Linux from an ISO img but it looks like I must have messed up the partitioning/formatting. The only reason I'm trying to install Linux is so that I have a working GRUB setup.

You don't need to install a complete Linux distribution only to get GRUB.

There are sysutils/grub2-pcbsd and sysutils/grub2-efi in ports. But those come with a heavy dependency, lang/gcc12, which occupies 324MiB, flat size.

Alternatively, when BIOS, one can create a dedicated partition for GRUB and install the files there from a Linux live CD. Create a unformated bios-boot partition (1M in size) for embedding GRUB boot data, following a linux-data partition for GRUB files, including grub.cfg, 100M in size. The needed space is less than 15M, but it doesn't hurt to have spare space. For bios-boot and linux-data see gpart(8).

Format the linux-data partition from a Linux live system mkfs.ext4, mount it, run as root grub-install --root-directory=/mnt /dev/sdx.

When UEFI, mount the FAT32 ESP, run the same command.

Edit /mnt/boot/grub/grub.cfg for menu entries.
 
You don't need to install a complete Linux distribution only to get GRUB.

There are sysutils/grub2-pcbsd and sysutils/grub2-efi in ports. But those come with a heavy dependency, lang/gcc12, which occupies 324MiB, flat size.

Alternatively, when BIOS, one can create a dedicated partition for GRUB and install the files there from a Linux live CD. Create a unformated bios-boot partition (1M in size) for embedding GRUB boot data, following a linux-data partition for GRUB files, including grub.cfg, 100M in size. The needed space is less than 15M, but it doesn't hurt to have spare space. For bios-boot and linux-data see gpart(8).

Format the linux-data partition from a Linux live system mkfs.ext4, mount it, run as root grub-install --root-directory=/mnt /dev/sdx.

When UEFI, mount the FAT32 ESP, run the same command.

Edit /mnt/boot/grub/grub.cfg (UEFI: /mnt/efi/boot/grub/grub.cfg) for menu entries.

This looks like the sort of thing I'd like to do, but not really sure where to start.

Assuming I have two disks da0 and da1 where da0 has an installed version of FreeBSD 13.1 and da1 is a blank 100GB disk. I want to install GRUB on da1 and be able to boot FreeBSD as well as two or three other OSes. How should I partition/format it ? Assuming EFI and GPT...
 
If it's UEFI why not simply create a EFI boot entry for each OS and select that entry from the machines startup device menu (one of the function keys)? See efibootmgr(8) EXAMPLES.

If you insist on GRUB
I want to install GRUB on da1
Never installed GRUB from ports, only from a Linux live CD.

From FreeBSD
Code:
gpart create -s gpt da1
gpart add -t efi -a 4k -s 260m da1
newfs_msdos -c 1 -F 32 /dev/da1p1

Reboot into a Linux live CD, mount the ESP from da1, run grub-install --root-directory=/mnt /dev/sdb. That should also create a EFI boot entry set to boot first.

Following OS installations most likely will put their EFI boot entry in front of the boot entry generated by grub-install. In this case change the boot order with efibootmgr -o x,y,z,...

Next, edit /mnt/boot/grub/grub.cfg.

Example FreeBSD menu entries:
Code:
menuentry "FreeBSD UFS" {
    root=(hd0,gpt2)
    chainloader /boot/loader.efi
}

menuentry "FreeBSD ZFS" {
    search -s -l zroot
    chainloader /ROOT/default@/boot/loader.efi
}
 
You don't need to install a complete Linux distribution only to get GRUB.
Actually, I have now discovered Ventoy thanks to a post on this forum and no longer need to think about GRUB.
It really is an excellent tool for launching various OSes and you can even boot ISO's of FreeBSD and mfsBSD just by copying ISO's to the first partition of your Ventoy device.
 
Back
Top