# Unable to mount linux-data



## ls4680 (Nov 21, 2014)

I have an old hard drive and I would like to see what is on it but I can not figure out how to mount it.  Thanks in advance.


```
root@desk92:/var/run # grep ada1 /var/run/dmesg.boot
ada1 at ata3 bus 0 scbus3 target 0 lun 0
ada1: <ST2000VM003-1CT164 ES22> ATA-8 SATA 3.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
ada1: Previously was known as ad6

root@desk92:~ # uname -a
FreeBSD desk92.galacticnet.com 9.2-RELEASE-p9 FreeBSD 9.2-RELEASE-p9 #0 r268136: Wed Jul  2 06:18:17 PDT 2014  op@desk92.galacticnet.com:/usr/obj/usr/src/sys/desk92.kern  amd64

root@desk92:~ # ll /dev/ada1*
crw-r-----  1 root  operator  0x63 Nov 20 21:32 /dev/ada1
crw-r-----  1 root  operator  0x73 Nov 20 21:32 /dev/ada1s1
crw-r-----  1 root  operator  0x75 Nov 20 21:32 /dev/ada1s2
crw-r-----  1 root  operator  0x77 Nov 20 21:32 /dev/ada1s3

root@desk92:~ # gpart show /dev/ada1
=>          63  3907029105  ada1  MBR  (1.8T)
              63          1985  - free -  (992k)
          2048  48828120  1  linux-data  (23G)
  48830168  97656248  2  linux-data  (46G)
  146486416  3760542752  3  linux-data  (1.8T)

root@desk92:/var/run # mount -t ext2fs /dev/ada1s3 /mnt/old
mount: /dev/ada1s3: Invalid argument

root@desk92:/var/run # mount -t ext3fs /dev/ada1s3 /mnt/old
mount: /dev/ada1s3: Operation not supported by device

root@desk92:/var/run # mount -t xfs /dev/ada1s3 /mnt/old
mount: /dev/ada1s3: Operation not permitted
```


----------



## rmoe (Nov 21, 2014)

Sorry for being very pragmatic but why don't you simply boot a Linux live CD for one-time jobs like that?


----------



## ls4680 (Nov 21, 2014)

I have zero experience with Linux but I like the suggestion. I will look into obtaining a Linux live CD.


----------



## wblock@ (Nov 21, 2014)

linux-data is just a partition type.  Use file(1) to find out which filesystem is on those partitions: `file /dev/ada1s1`.

If it is ext2 or 3, FreeBSD can mount those with `mount -t ext2fs /dev/ada1s1 /mnt`.


----------



## acheron (Nov 21, 2014)

Or your filesystem may be dirty, try to run `fsck.ext3 /dev/ada1s3` (fsck.ext3 comes from sysutils/e2fsprogs)


----------



## rmoe (Nov 21, 2014)

wblock@ is, of course, right as usual. But as not everyone is a Unix guru I'd like to extend somewhat on his advice and also explain what I said earlier.

linux-data is just a partition type. But I guess that in >= 99.5% of cases it's been created and used for/by Linux although theoretically those partitions might be formatted as NTFS or whatnot.

Is a rare (I suppose) "Gee, I wonder what's on that drive?" worth to install Linux stuff (like EXT2/3 support) on FreeBSD?

My suggestion is to download Puppy Linux which is small, quite powerful, and friendly. It has a GUI, many relevant tools and some newbie-friendly warning shots built-in. And it doesn't change a bit of your production system.


----------



## wblock@ (Nov 22, 2014)

ext2fs(5) is native, included in the base system.  It also supports ext3, which is apparently compatible.


----------



## tingo (Dec 14, 2014)

FWIW, I use sysutils/disktype for these questions; it is small, has just a few dependencies and builds quickly on any FreeBSD system.
Here is an example:

```
root@kg-core1# disktype /dev/da0*

--- /dev/da0
Character device, size 7.208 GiB (7739768832 bytes)
FreeBSD boot loader (i386 boot1 at sector 0)
FreeBSD boot loader (i386 boot2/BTX 1.02 at sector 2)
BSD disklabel (at sector 1), 8 partitions
Partition a: 699.4 MiB (733364224 bytes, 1432352 sectors from 0)
  Type 7 (4.2BSD fast file system)
  Includes the disklabel and boot code
  UFS file system, 8 KiB offset, little-endian
  Volume name "FreeBSD_Install" (in superblock)
  Last mounted at "/"
Partition c: 699.4 MiB (733364224 bytes, 1432352 sectors from 0)
  Type 0 (Unused)

--- /dev/da0a
Character device, size 699.4 MiB (733364224 bytes)
FreeBSD boot loader (i386 boot1 at sector 0)
FreeBSD boot loader (i386 boot2/BTX 1.02 at sector 2)
BSD disklabel (at sector 1), 8 partitions
Partition a: 699.4 MiB (733364224 bytes, 1432352 sectors from 0)
  Type 7 (4.2BSD fast file system)
  Includes the disklabel and boot code
  UFS file system, 8 KiB offset, little-endian
  Volume name "FreeBSD_Install" (in superblock)
  Last mounted at "/"
Partition c: 699.4 MiB (733364224 bytes, 1432352 sectors from 0)
  Type 0 (Unused)
```


----------



## balanga (Feb 22, 2017)

I just had a similar problem and have stumbled upon this two year old thread....

I came across a 64GB micro SDHC card and wanted to know what was on it. Following instructions outlined above, I installed sysutils/disktype  and it showed a particular partition as ext3fs, which I thought FreeBSD could handle, but it wouldn't.
Eventually I booted up some version of Linux and it turns out the partition is ext4fs. I don't know if FreeBSD can handle this.

In any case, is there any way to identify which version of Linux is installed just from the filesystem?


----------



## SirDice (Feb 22, 2017)

balanga said:


> In any case, is there any way to identify which version of Linux is installed just from the filesystem?


Look at the /etc/*release file. Yes, that's a wildcard in there, every distribution uses a different name for the file, but it always ends with release.


----------



## scottro (Feb 22, 2017)

As for mounting ext4fs, yes, FreeBSD can do that.   Install sysutils/fuserfs-ext4fuse.


```
kldload fuse.ko
ext4fuse /dev/whatever /mnt/
```
(Or whereever)


----------



## balanga (Feb 22, 2017)

SirDice said:


> Look at the /etc/*release file. Yes, that's a wildcard in there, every distribution uses a different name for the file, but it always ends with release.



It's Raspbian Wheezy, for my Raspberry Pi  I had forgotten I had that...it's over two years since I installed it.


----------



## islamux (Jul 12, 2017)

scottro said:


> As for mounting ext4fs, yes, FreeBSD can do that.   Install sysutils/fuserfs-ext4fuse.
> 
> 
> ```
> ...


how to make it in virtualbox 
i'm using freebsd like a guest in arch


----------



## crashcoredump (Dec 21, 2019)

Not to revive an old thread but this does come up in search results, so a bit of improvement, imo:



wblock@ said:


> Use file(1) to find out which filesystem is on those partitions: `file /dev/ada1s1`.



This will only result in:

`# file /dev/da4s1
/dev/da4s1: character special (0/233)
#`

vs

`# file -s /dev/da4s1
/dev/da4s1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "MSDOS5.0", sectors/cluster 64, reserved sectors 10112, Media descriptor 0xf8, sectors/track 63, heads 128, hidden sectors 8064, sectors 60557952 (volumes > 32 MB), FAT (32 bit), sectors/FAT 7392, reserved1 0x73496850, reserved2 0x6e4f, serial number x*******f, label: "P*****T "
#`


----------

