There's a command or method to cause the kernel to create partition device files. Unfortunately, I don't recall the details offhand. I vaguely recall setting this up as a udev rule once, so it may be something that's built into udev; or it could be I launched an external command using a udev rule. Either way, try doing a Web search on "Linux create partition device files" or something similar. In fact, it's conceivable that these files already exist; you can search for /dev/nbd0*; if there are additional files (like /dev/nbd01, /dev/nbd02, and /dev/nbd03), they refer to the partitions on the device.
Export only the partition you want. I don't know what software you're using on the Mac side, but if it's even remotely flexible, it should provide a way for you to export partition 2 on the target disk without exporting the whole disk. This is likely to be the simplest solution, assuming the software on the Mac side supports this.
# parted /dev/nbd0
GNU Parted 3.1
Using /dev/nbd0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Unknown (unknown)
Disk /dev/nbd0: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: mac
Disk Flags:
Number Start End Size File system Name Flags
1 512B 32.8kB 32.3kB Apple
2 32.8kB 10.2GB 10.2GB ext4 untitled
3 10.2GB 10.7GB 508MB swap swap
(parted) unit B
(parted) p
Model: Unknown (unknown)
Disk /dev/nbd0: 10737418240B
Sector size (logical/physical): 512B/512B
Partition Table: mac
Disk Flags:
Number Start End Size File system Name Flags
1 512B 32767B 32256B Apple
2 32768B 10229033471B 10229000704B ext4 untitled
3 10229033472B 10737417727B 508384256B swap swap
(parted) q
# mount -o loop,offset=32768 /dev/nbd0 /mnt
CONFIG_MAC_PARTITION=y
is referring to APM.
]]>gdisk should be able to recognise that it is APM but not to manipulate the data.
Linux can definitely use APM - there shouldn't be anything odd about it that I can think of. You can install Linux on a disk with this type of partition map and it works fine. (I set a PPC mac up to dual boot OS X and GNU/Linux and it has to be APM for the former.)
]]>In fact, do you know what sort of partition table it is? I'm not sure what parted means by "mac". Does that mean Apple Partition Map? Or a newer type? Or something else?
gdisk can recognise APM but I can't find mention of that in fdisk's manual page.
]]>hfsutils will not work with hfs+ partitions.
OK. I just reread your first post. Is this an ext4 partition as gparted claims? In that case, you should be able to mount it in the usual way and nothing fancy should be required at all. What have you tried?
]]>hmount /dev/nbd0 2
/dev/nbd0: contains 0 HFS partitions
hmount: /dev/nbd0: partition not found (Invalid argument)
hfsprogs /usr/bin/fsck.hfsplus
hfsprogs /usr/bin/mkfs.hfsplus
$ parted /dev/nbd0
WARNING: You are not superuser. Watch out for permissions.
GNU Parted 3.1
Using /dev/nbd0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Unknown (unknown)
Disk /dev/nbd0: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: mac
Disk Flags:
Number Start End Size File system Name Flags
1 512B 32.8kB 32.3kB Apple
2 32.8kB 10.2GB 10.2GB ext4 untitled
4 10.2GB 10.7GB 508MB swap swap
(parted)
But fdisk says:
$ fdisk /dev/nbd0
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xcf879138.
How can I mount the ext4 partition shown by parted? I've tried to load the hfs and hfsplus modules to no effect. Please help!
]]>