Scratch Disk (Partitioned)

Prev Next

NOTE: This is for the FMADIO Portable Capture Systems only.

FMADIO systems allow disks to be allocated as Capture disks or Scratch disks. This allows fully dedicated hardware resources for each purpose such that operations on the Scratch Disk does not interfere with operations on the Capture disks. Default configuration is shown in the figure below

In some cases such as the FMADIO Portable systems with removable disk packs, dedicating an entire large capacity drive just for 100GB of file system metadata is a waste of hardware resources. As such the below disk partitioning is possible.

The following steps are provided to configure the system. This requires FW 10262+ to be installed first.

Step 1) Configure the disks

By default the disk configuration is for dedicated hardware per device type. For example the default config file

/opt/fmadio/etc/disk.lua

Will look similar to this

return
{
        CacheDisk =
        {
                ["xxxx204F"]              = "ssd0",
                ["xxxxBFC3"]              = "ssd1",
                ["xxxx3AFF"]              = "ssd2",
                ["xxxxC543"]              = "ssd3",
                ["xxxx2076"]              = "ssd4",
                ["xxxx3B41"]              = "ssd5",
                ["xxxx3B65"]              = "ssd6",
                ["xxxx20A4"]              = "ssd7",
        }
        ,
        ParDisk =
        {
                ["xxx087"]                = "par0",
        }
        ,
        RaidDisk =
        {
        }
        ,
        ScratchDisk =
        {
                ["xxxxC54E"]              = "scr0",
      
        }
        ,
        OSDisk =
        {
        ["xxxxxx"] = "os0",
        }
        ,
        IndexDisk = "ssd",
        CacheLevel = "full",
}

This needs to be changed such that the a partition number is specified for each mount point. For example using partition 1 for ssd0

Before

["xxxx204F"]              = "ssd0",

After with partition number

["xxxx204F:1"]              = "ssd0",

Can see the above :1  has been added next to the serial number. This designates the partition to use for that mount point (in this case ssd0).

Step 2) Add all Capture disks to Scratch disks in the config

Next need to add all Capture disks (including Parity disk) to the Scratch disk config. Adding in a :2 after the serial number to indicate using the 2nd partition.

Example below

/opt/fmadio/etc/disk.lua

return
{
        CacheDisk =
        {
                ["xxxx204F:1"]              = "ssd0",
                ["xxxxBFC3:1"]              = "ssd1",
                ["xxxx3AFF:1"]              = "ssd2",
                ["xxxxC543:1"]              = "ssd3",
                ["xxxx2076:1"]              = "ssd4",
                ["xxxx3B41:1"]              = "ssd5",
                ["xxxx3B65:1"]              = "ssd6",
                ["xxxx20A4:1"]              = "ssd7",
                ["xxxxC54E:1"]              = "ssd8",
        }
        ,
        ParDisk =
        {
                ["xxx0087:1"]                = "par0",
        }
        ,
        RaidDisk =
        {
        }
        ,
        ScratchDisk =
        {
                ["xxxx204F:2"]              = "scr0",
                ["xxxxBFC3:2"]              = "scr1",
                ["xxxx3AFF:2"]              = "scr2",
                ["xxxxC543:2"]              = "scr3",
                ["xxxx2076:2"]              = "scr4",
                ["xxxx3B41:2"]              = "scr5",
                ["xxxx3B65:2"]              = "scr6",
                ["xxxx20A4:2"]              = "scr7",
                ["xxxxC54E:2"]              = "scr8",
                ["xxxx0087:2"]              = "scr9", 
        }
        ,
        OSDisk =
        {
        ["xxxxxx"] = "os0",
        }
        ,
        IndexDisk = "ssd",
        CacheLevel = "full",
}

Notice how we have 1 extra Capture disk now (ssd8). We reclaimed this from the dedicated scratch disk, enables larger capture capacity.

Step 3) Check for Syntax errors

After updating per above, check the file for syntax errors

fmadiolua /opt/fmadio/etc/disk.lua

Example correct output like below

fmadio@fmadio100p3-539:~$ fmadiolua /opt/fmadio/etc/disk.lua
fmad fmadlua Nov 15 2024 (fmadiolua /opt/fmadio/etc/disk.lua )
calibrating...
0 : 3000024810           3.0000 cycles/nsec offset:0.025 Mhz
Cycles/Sec 3000024810.0000 Std:       0 cycle std(  0.00000000) Target:3.00 Ghz
failed to open self? [fmadiolua]
done 0.000046Sec 0.000001Min
fmadio@fmadio100p3-539:~$

Step 4) Partition the disk array

Repartition the disk array using the following command

sudo format_scratch.lua --partition

This will automatically reformat the array and create the appropriate mount points

Step 5) Reboot

Reboot the system to ensure the partitions have been created correctly

sudo reboot

Step 6) Quick format the disk

When reboot has completed, need to quick format the system again. As the storage topology/ has now changed

fmadiocli "config disk format"

This will take about 5 minutes, the system will reboot twice.

Step 7) Confirm new Disk Partitions

Once completed run the following command to check capture file system is good

sudo stream_dump

Example output looks like the following

Streams:
 [0001]        test_20241115_1218    871GB Chunk(Cnt: 3571443 Start:       0 End: 3571442 Comp:0.00) Inv:-nan Cap:-nan CacheI:-nan Cache:-nan Disk:-nan Drop:-nan Pkt:0

Capture Size   :              871 GB (0.0272%)
Physical Size  :            32048 GB
Maximum  Size  :            34412 GB
Compress Ratio :              inf %
Cache Cnt      :                9 x   3824 GB ( 34412 GB)
Store Cnt      :                9 x   3824 GB ( 34412 GB)
ECC Cnt        :                1 x   3824 GB

Next Cache     :          3571443 :        131271921
Next Store     :                0 :         32817960
Next Chunk     :          3571443 :        131271840

Validate Enable:                0
Validate Offset:                0
Validate Size  :                0 (0.00GB)
fmadio@fmadio100p3-539:~$

Also confirm the scratch partition ( /mnt/store1 ) has been created correctly with the appropriate size

lsblk

Output looks like the following

NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
nvme4n1      259:0    0   3.5T  0 disk
|-nvme4n1p1  259:3    0   3.5T  0 part
`-nvme4n1p2  259:4    0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme6n1      259:1    0   3.5T  0 disk
|-nvme6n1p1  259:6    0   3.5T  0 part
`-nvme6n1p2  259:7    0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme3n1      259:2    0   3.5T  0 disk
|-nvme3n1p1  259:9    0   3.5T  0 part
`-nvme3n1p2  259:10   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme8n1      259:5    0   3.5T  0 disk
|-nvme8n1p1  259:11   0   3.5T  0 part
`-nvme8n1p2  259:12   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme0n1      259:8    0 476.9G  0 disk
|-nvme0n1p1  259:13   0  14.9G  0 part  /mnt/nvme0n1p1
`-nvme0n1p2  259:14   0   462G  0 part  /mnt/store0
nvme1n1      259:15   0   3.5T  0 disk
|-nvme1n1p1  259:18   0   3.5T  0 part
`-nvme1n1p2  259:19   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme2n1      259:16   0   3.5T  0 disk
|-nvme2n1p1  259:20   0   3.5T  0 part
`-nvme2n1p2  259:21   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme9n1      259:17   0   3.5T  0 disk
|-nvme9n1p1  259:22   0   3.5T  0 part
`-nvme9n1p2  259:23   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme7n1      259:24   0   3.5T  0 disk
|-nvme7n1p1  259:25   0   3.5T  0 part
`-nvme7n1p2  259:26   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme10n1     259:27   0   3.5T  0 disk
|-nvme10n1p1 259:29   0   3.5T  0 part
`-nvme10n1p2 259:31   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1
nvme5n1      259:28   0   3.5T  0 disk
|-nvme5n1p1  259:30   0   3.5T  0 part
`-nvme5n1p2  259:32   0    16G  0 part
  `-md1        9:1    0 143.9G  0 raid5 /mnt/store1

NOTE: the /mnt/store1 partition is around 140GB

Step 8) Finished

That completes the re-partitioning of the storage. Any questions please contact

If you have questions, problems or feedback related to this topic please contact support@fmad.io.