# Mounting QNX filesystems in Linux

## New User

Hello all, I've been trying to mount a drive that fdisk identifies as having QNX filesystems:

Here is the partition table:

```

The number of cylinders for this disk is set to 9729.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdd: 80.0 GB, 80026361856 bytes

255 heads, 63 sectors/track, 9729 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x6ad4b821

   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1        9729    78148161    5  Extended

/dev/sdd5               1        7311    58725544+  4d  QNX4.x

/dev/sdd6            7312        7694     3076416   4d  QNX4.x

/dev/sdd7            7695        7907     1710891   4d  QNX4.x

/dev/sdd8            7908        8050     1148616   4d  QNX4.x

/dev/sdd9            8051        9708    13317853+  4d  QNX4.x

/dev/sdd10           9709        9729      168651   4d  QNX4.x

Command (m for help):

```

When I mount attempt to mount it, I get this (Note, I Do have QNX compiled into my 2.6.31-gentoo-r6 kernel):

```
# mount -r -t qnx4 /dev/sdd5 /mnt/part5

mount: wrong fs type, bad option, bad superblock on /dev/sdd5,

       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

# 

```

When looking at the dmesg, the corresponding meassage is:

```
[491888.416730] qnx4: wrong fsid in superblock.

```

After using dd to copy the partitions into files, when looking at the strings of the images, I do get references to QNX:

```
# strings Part5.dd | head

QNX v1.2a Boot Loader

Unsupported BIOS

RAM Error

Disk Read Error

Missing OS Image

Invalid OS Image

Unsupported Multi-Boot

f&;M

f&;M

u:f1

# 
```

Still not sure why I cannot mount it, though.  For those of you that are curious, this is the hard drive from a 2010 BMW 3-series iDrive system (CIC).

----------

## tgR10

can you show us output from

```
cat /proc/filesystems 
```

you did wrote that qnx file system support is built into the kernel ... but it just look like it ain't :P

----------

## New User

```
# cat /proc/filesystems 

nodev   sysfs

nodev   rootfs

nodev   bdev

nodev   proc

nodev   cgroup

nodev   cpuset

nodev   binfmt_misc

nodev   debugfs

nodev   sockfs

nodev   pipefs

nodev   anon_inodefs

nodev   tmpfs

nodev   inotifyfs

nodev   configfs

nodev   devpts

            reiserfs

           ext3

            ext2

nodev   ramfs

nodev   hugetlbfs

           vfat

           msdos

           iso9660

           hfsplus

nodev   nfs

nodev   nfs4

           sysv

           v7

           ntfs

           ufs

           qnx4

nodev   autofs

           udf

           jfs

nodev   mqueue

nodev   selinuxfs

nodev   rpc_pipefs

#

```

----------

## tgR10

as we can see it is supported by the kernel so i got no more ideas

maybe it wasn't cleanly unmounted before ?

----------

## ndse2112

fdisk is just showing you the partition type

If your kernel knows about the filesystem on the device the following should tell you:

```

mount -f --guess-fstype /path

```

----------

## New User

The drive may be encrypted although I'm unsure since the strings command shows plenty of interesting recognizable data when I run it on the image.

The drive works as expected in the environment it was meant for (the car) and all of its data is intact so I don't think it is an unclean dismount.  Also, everything I've been reading about the qnx filesystem is that they are very robust when it comes to unclean dismounts. 

However I have a feeling that it is not a precise qnx filesystem, or the partition table is specialized.

I am pretty sure that it is related to qnx as the first several lines of the image also confirm it (as mentioned above).

I built a qnx machine and to attempt to mount the drive from within qnx and it thinks that the filesystem is corrupt.  I am thinking it is a proprietary qnx-like filesystem that Harmon developed for this application.  Now I just need to read up on filesystem development to figure out how to reverse engineer it.

The goals are to expand the existing partitions and to be able to browse and write to it.

----------

