Mass storage gadget woes (wrong capacity)
by lalaw from LinuxQuestions.org on (#5DVMQ)
Hello all.
I'm in the process of setting up a Helios64, which is an Armbian based NAS that happens to have a USB DAS mode. My hope is to enable DAS mode on a specific partition to enable high-performance RW for my photo library.
I'm having strange issues with the mass storage gadget where the device is showing at substantially lower capacity than actual. I'm also having some weird filesystem issues, to be detailed below.
(1) Sharing Raid Array
modprobe g_mass_storage file=/dev/mdX iManufacturer="xxxx" iProduct="xxxx" iSerialNumber="1234567890" ro=0 removable=1 stall=0
This is a RAID 10 array, which should have total capacity ~20TB (4x 10 TB disks). When attaching to my Mac, it sees a drive that is ~210GB.
(2) Sharing a Raid Partition
modprobe g_mass_storage file=/dev/mdXp1 iManufacturer="xxxx" iProduct="xxxx" iSerialNumber="1234567890" ro=0 removable=1 stall=0
Strangely, this is the one time I get the Mac to see the full size (~20TB), but in this case, I'm getting weird filesystem unrepairable errors (using exFat). I've tried a dozen different ways of repartitioning, fixing the GPT, setting the partition type, etc. to no avail. When trying to reformat, the disks jumps back down from 20TB to the 210GB.
(3) Sharing a disk/disk partition
modprobe g_mass_storage file=/dev/sdX iManufacturer="xxxx" iProduct="xxxx" iSerialNumber="1234567890" ro=0 removable=1 stall=0
In this case, trying to share a 10TB disk, and I get a capacity of 1.2TB.
Originally, I was trying to share the raw, unformatted block devices so that the mac could format them and then I could mount them in Linux, but I've been trying various approaches to try to get a readable FS at full capacity.
Any insights would be appreciated.


I'm in the process of setting up a Helios64, which is an Armbian based NAS that happens to have a USB DAS mode. My hope is to enable DAS mode on a specific partition to enable high-performance RW for my photo library.
I'm having strange issues with the mass storage gadget where the device is showing at substantially lower capacity than actual. I'm also having some weird filesystem issues, to be detailed below.
(1) Sharing Raid Array
modprobe g_mass_storage file=/dev/mdX iManufacturer="xxxx" iProduct="xxxx" iSerialNumber="1234567890" ro=0 removable=1 stall=0
This is a RAID 10 array, which should have total capacity ~20TB (4x 10 TB disks). When attaching to my Mac, it sees a drive that is ~210GB.
(2) Sharing a Raid Partition
modprobe g_mass_storage file=/dev/mdXp1 iManufacturer="xxxx" iProduct="xxxx" iSerialNumber="1234567890" ro=0 removable=1 stall=0
Strangely, this is the one time I get the Mac to see the full size (~20TB), but in this case, I'm getting weird filesystem unrepairable errors (using exFat). I've tried a dozen different ways of repartitioning, fixing the GPT, setting the partition type, etc. to no avail. When trying to reformat, the disks jumps back down from 20TB to the 210GB.
(3) Sharing a disk/disk partition
modprobe g_mass_storage file=/dev/sdX iManufacturer="xxxx" iProduct="xxxx" iSerialNumber="1234567890" ro=0 removable=1 stall=0
In this case, trying to share a 10TB disk, and I get a capacity of 1.2TB.
Originally, I was trying to share the raw, unformatted block devices so that the mac could format them and then I could mount them in Linux, but I've been trying various approaches to try to get a readable FS at full capacity.
Any insights would be appreciated.