4

I currently have FreeBSD version FreeBSD 10.0-RELEASE. Installed using a ZFS root. I'm attempting to mount a MBR partitioned drive but I can't get the partition nodes, /dev/ada4p1, etc. The partitions are formatted to EXT2.

Is there a kernel module or command I need to run to gain access to partitions on ada4?

[root@core /mnt]# ls -l /dev/ada*
crw-r-----  1 root  operator  0x76 May  2 10:29 /dev/ada0
crw-r-----  1 root  operator  0x79 May  2 10:29 /dev/ada0p1
crw-r-----  1 root  operator  0x7b May  2 10:29 /dev/ada0p2
crw-r-----  1 root  operator  0x7d May  2 10:29 /dev/ada0p3
crw-r-----  1 root  operator  0x8b May  2 10:29 /dev/ada0p4
crw-r-----  1 root  operator  0x9f May  2 10:29 /dev/ada0p4.eli
crw-r-----  1 root  operator  0x8d May  2 10:29 /dev/ada1
crw-r-----  1 root  operator  0x98 May  2 10:30 /dev/ada1.eli
crw-r-----  1 root  operator  0x8f May  2 10:29 /dev/ada2
crw-r-----  1 root  operator  0xa1 May  2 10:30 /dev/ada2.eli
crw-r-----  1 root  operator  0x91 May  2 10:29 /dev/ada3
crw-r-----  1 root  operator  0xa2 May  2 10:30 /dev/ada3.eli
crw-r-----  1 root  operator  0x93 May  2 10:29 /dev/ada4


[root@core /mnt]# fdisk /dev/ada4
******* Working on device /dev/ada4 *******
parameters extracted from in-core disklabel are:
cylinders=7752021 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=7752021 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 131 (0x83),(Linux native)
    start 1, size 3906250000 (1907348 Meg), flag 0
        beg: cyl 0/ head 0/ sector 2;
        end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 131 (0x83),(Linux native)
    start 3906250752, size 3907784704 (1908098 Meg), flag 0
        beg: cyl 1023/ head 254/ sector 63;
        end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
4
  • fdisk is kind of legacy. Can you show us the result of gpart ada4 please?
    – Ouki
    May 2 '14 at 7:29
  • Here is the gpart for ada4 ` root@core:~ # gpart list /dev/ada4 gpart: No such geom: /dev/ada4. root@core:~ # ` The disk was created on a linux machine using parted. This handled the creation of both the partition table and the two partitions.
    – Dan
    May 2 '14 at 12:24
  • I meant gpart show ada4 ... but it seems your ada4 disk is not mapped properly by the geom driver.
    – Ouki
    May 2 '14 at 16:00
  • Normally, your partitions would show up as /dev/ada4s1 and /dev/ada4s2 (p# is for GPT partitions, s# is MBR slices).
    – Allan Jude
    Jun 15 '14 at 16:14
1

It seems your Linux formatted /dev/ada4 MBR disk is not recognized properly by FreeBSD geom driver. So it can be seen through the legacy fdisk utility, but not through gpart show ada4.

It might be due to the fact that this ada4 device is obviously using some non-standard MBR extension to handle 2TB+ disks (2 partitions that are almost 2 TB each).

From MBR wikipedia:

MBR partition entries and the MBR boot code used in commercial operating systems, however, are limited to 32 bits. Therefore, the maximum disk size supported on disks using 512-byte sectors (whether real or emulated) by the MBR partitioning scheme (without using non-standard methods) is limited to 2 TB. Consequently, a different partitioning scheme must be used for larger disks, as they have become widely available since 2010. The MBR partitioning scheme is therefore in the process of being superseded by the GUID Partition Table (GPT). The official approach does little more than ensuring data integrity by employing a protective MBR. Specifically, it does not provide backward compatibility with operating systems that do not support the GPT scheme as well. In the meanwhile, multiple forms of hybrid MBRs have been designed and implemented by third-parties in order to maintain partitions located in the first physical 2 TB of a disk in both partitioning schemes "in parallel" and/or to allow older operating systems to boot off GPT partitions as well. The present, non-standard nature, of these solutions can cause various compatibility problems in certain scenarios though.

FreeBSD preference is now about GPT partitioning scheme and both MBR and the fdisk utility are to consider legacy regarding non-removable media.

1
  • Do you know of any alternative way to get the data off the drive and onto freeBSD without purchasing another hdd ?
    – Dan
    May 3 '14 at 3:02
1

Try running:

kldload geom_part_mbr.ko

then gpart show /dev/ada4

Your two 2TB partitions should be listed as /dev/ada4s1 and /dev/ada4s2

However, using MBR on disks over 2TB is non-standard, so it might not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.