Solved Mount old Linux drives

I'm trying to mount two old Linux HDDs after successfully installing FreeBSD with KDE as a DE.

This is what I have:

Code:
# gpart show
=>       40  488397088  nda0  GPT  (233G)
         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528    4194304     3  freebsd-swap  (2.0G)
    4728832  483667968     4  freebsd-zfs  (231G)
  488396800        328        - free -  (164K)

=>        63  1953525105  ada0  MBR  (932G)
          63        1985        - free -  (993K)
        2048  1953523120     1  linux-data  (932G)

=>        63  1953525105  ada1  MBR  (932G)
          63        1985        - free -  (993K)
        2048  1953523120     1  linux-data  (932G)

I have installed fusefs, but it doesn't seem to do the trick:

Code:
# kldload fusefs
# kldload fusefs
kldload: can't load fusefs: module already loaded or in kernel

mount -t fusefs /usr/local/bin/fuse-ext4 /dev/ada0 /mnt/linux

What am I missing here?
 
Perhaps that /dev/ada0 is the entire disk and you really only need to mount the linux partition?
What does "ls -ltr /dev/ada*" tell you?
I'm assuming you should something like /dev/ada0s1 or /dev/ada0p1 which would be the actual Linux filesystem.
I'm not sure if you actually need fusefs to mount ext[2|3|4] filesystems.
 
What does "ls -ltr /dev/ada*" tell you?
Yes you're probably right, and they're probably software mirrored too, this is what I get:

Code:
# ls -ltr /dev/ada*
crw-r-----  1 root operator 0x8c Jul  2 15:51 /dev/ada1s1
crw-r-----  1 root operator 0x83 Jul  2 15:51 /dev/ada1
crw-r-----  1 root operator 0x8a Jul  2 15:51 /dev/ada0s1
crw-r-----  1 root operator 0x81 Jul  2 15:51 /dev/ada0
 
Ok. Mirror means "one should be good enough", so I would try unplug one of them, say ada1, then try and mount /dev/ada0s1. If that works, you can poke around, see what's there then swap them:
unplug ada0, plug in ada1 (names may change) then mount /dev/ada1s1 and poke around. If that looks like "ada0s1" then yes mirror and work on only one of the pair.
 
for ext2/3/4 you can just use # mount -t ext2fs /dev/<device> /mount/path
Though if you used md arrays or similar I don't know if that will work. XFS will require the xfs fuse package.

But if you go with what mer said about mounting just one partition be sure to pass -o ro to ensure you don't mount it read write.
 
The best way to access Linux drives on Freebsd

Is dont mount them,
plug them into a Linux machine and then use syncthing to transfer the files

You will have a lot less hassle and faster transfer speeds
I would run some default linux in Qemu and add a physical disk as 2nd virtual drive and try to mount it. Linux won't notice.
But it's unclear what those disks are. Is it even bootable?
 
TBH, if it were me, I'd load up a live Linux USB drive to do filesystem checks and verify the details of the disk. If you've got a large enough spare disk, it's probably easier to just copy the files to that on a disk that's formatted in a way that plays nicer with FreeBSD. Or just use fat32 and a series of tar files that can be untared back to the disk after it's been formatted to whatever you like.
 
This should give you an idea of what to do
Code:
# kldload ext2fs.ko
# gpart show md1
=>      63  18956225  md1  MBR  (9.0G)
        63     16321       - free -  (8.0M)
     16384   1048576    1  fat32lba  (512M)
   1064960  17891328    2  linux-data  (8.5G)

# fsck.ext4 /dev/md1s2
e2fsck 1.47.4 (6-Mar-2025)
rootfs: clean, 184247/559728 files, 1971278/2236416 blocks
# pkg which `which fsck.ext4`
/usr/local/sbin/fsck.ext4 was installed by package e2fsprogs-core-1.47.4

# mount -r -t ext2fs /dev/md1s2 /mnt/
# ls /mnt
bin             home            mnt             run             tmp
boot            lib             opt             sbin            usr
dev             lost+found      proc            srv             var
etc             media           root            sys
 
IIRC, linux raid-1 is transparent so BSD (should) see any mirror slice as a mountable partition. If LVM was used then "fo-get-about-it"

Not anymore. I once put raid1 and raid0 Linux md support into CCD, but it never made it into GEOM.

`file -s /dev/<partition` is the way to find out which filesystem is on a partition. I don't know whether it knows about md raid and LVM.
 
Not anymore. I once put raid1 and raid0 Linux md support into CCD, but it never made it into GEOM.

`file -s /dev/<partition` is the way to find out which filesystem is on a partition. I don't know whether it knows about md raid and LVM.
diskadm just writes a signature in a safe spot on the partition. Then you "should" set the partition type to indicate it is linux-raid, but that's not necessary for linux-md to work.

What you mean "not anymore"?....as in no longer transparent, or as in we can now parse LVM disk groups?
 
We can't read md raid arrays anymore. We never could read LVM.
even a single half of an md-mirror? Hmmm....OK. I guess it depends on which version of the md metadata is used. The old V1.0 was stored at the end of the device so it would appear normal without the md drivers. This would be the preferred config for mirroring.
 
Thanks everyone, took a step forward with your help.
I was able to mount them (bakul) , but they were empty, as I thought, but wanted to be totally sure.
# file -s /dev/ gave me "ext4".

Now they're back renewed for FreeBSD:

Code:
# gpart show

=>        40  1953525088  ada0  GPT  (932G)
          40  1953525088     1  freebsd-zfs  (932G)

=>        40  1953525088  ada1  GPT  (932G)
          40  1953525088     1  freebsd-zfs  (932G)

Code:
# zpool status datapool
pool: datapool
state: ONLINE
config:

        NAME               STATE     READ WRITE CKSUM
        datapool           ONLINE       0     0     0
          mirror-0         ONLINE       0     0     0
            gpt/disk0_zfs  ONLINE       0     0     0
            gpt/disk1_zfs  ONLINE       0     0     0

errors: No known data errors
 
Back
Top