Error trying to mount FreeBSD/UFS partition from FreeNAS

20,877

Solution 1

You need to get the bsd partition, that fdisk -l cant show you.

First:

$ dmesg|grep bsd

[    3.467958]  sde1: <bsd:bad subpartition - ignored
[    3.467959]  sde2: <bsd: sde5 >

Look after a partion, in this case sde5 seemed to be the one fore me.

Then:

$ sudo mount -t ufs -r -o ufstype=ufs2 /dev/sde5 ~/freebsd

The forum answer that got me on the right track

Solution 2

There are many types of the UFS file system, those many are supported by the Linux Kernel but its very hard to automatically detect which type of UFS needs to be mounted, that is why you need to add the ufstype= argument to the mount command.

Possible common types are:

  • old old format of ufs
  • default value, supported as read-only
  • 44bsd used in FreeBSD, NetBSD, OpenBSD
  • ufs2 used in FreeBSD 5.x
  • 5xbsd synonym for ufs2
  • sun used in SunOS (Solaris)
  • sunx86 used in SunOS for Intel (Solarisx86)
  • hp used in HP-UX
  • nextstep used in NextStep
  • nextstep-cd used for NextStep CDROMs (block_size == 2048)
  • openstep used in OpenStep

Since you are comming from FreeNAS and that is based on FreeBSD I recommend you try ufs2 or 44bsd in the ufstype= parameter.

More information here in the Linux Kernel documentation.

Share:
20,877

Related videos on Youtube

Tim
Author by

Tim

Hi everybody! I'm working as SharePoint developer for a small consulting firm in Malmö, Sweden. I have a background as an informatics student and have done some light developing in web development, both in ASP.NET and PHP/MySQL. I like programming with C#.NET, jQuery, HTML and more typical SharePoint relative techniques. At home I've just begun using Ubuntu instead of my old FreeNAS 7.2 machine.

Updated on September 18, 2022

Comments

  • Tim
    Tim over 1 year

    I get this strange error trying to mount UFS partition.

       sudo mount -r -t ufs -o ufstype=ufs2 /dev/sdb2 /home/tim/ufs_mount
       mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
              missing codepage or helper program, or other error
              In some cases useful info is found in syslog - try
              dmesg | tail  or so
    

    I'm a Ubuntu newbie and just switched from FreeNAS.

    tim@T3:~$ sudo fdisk -l
    
    Disk /dev/sda: 400.1 GB, 400088457216 bytes
    255 heads, 63 sectors/track, 48641 cylinders, total 781422768 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000a77a6
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048   765700095   382849024   83  Linux
    /dev/sda2       765702142   781422591     7860225    5  Extended
    /dev/sda5       765702144   781422591     7860224   82  Linux swap / Solaris
    
    Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
    255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x90909090
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *          63      240974      120456   a5  FreeBSD
    /dev/sdb2          240975  2928601304  1464180165   a5  FreeBSD
    /dev/sdb3      2928601305  2930272064      835380   a5  FreeBSD
    
    • Admin
      Admin over 12 years
      Are you sure it's a UFS partition? Post the output of sudo fdisk -l.
    • Admin
      Admin over 12 years
      Actually im not sure anymore. I successfully mounted another partition from another disk. More info about that in this question.
  • Tim
    Tim over 12 years
    Hi Bruno! Nice to see you again! I tried this yesterday actually, but none worked :(
  • Tim
    Tim over 12 years
    Thanks for your answer, but there was nothing mounted.
  • Bruno Pereira
    Bruno Pereira over 12 years
    I am shocked :( Ill look for a better way of identifying the UFS type and add a comment if I find anything else.
  • Tim
    Tim over 12 years
    That would be very nice of you! Another though might be if there is some way to check for errors in the partition somehow? Maybe there is something wrong with the "superblock"?
  • Bruno Pereira
    Bruno Pereira over 12 years
    Think there is a package called ufsutils with a fs checker, not 100% sure about the name atm, loof for ufs in the Ubuntu Software Center.