--- title: "Scratch Disk (Partitioned)" slug: "fmadio-os-storage-scratch-partition" updated: 2024-11-15T05:00:22Z published: 2024-11-15T05:00:22Z canonical: "docs.fmad.io/fmadio-os-storage-scratch-partition" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.fmad.io/llms.txt > Use this file to discover all available pages before exploring further. # Scratch Disk (Partitioned) #### **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 ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(46).png?sv=2026-02-06&spr=https&st=2026-11-24T16%3A13%3A18Z&se=2026-11-24T17%3A13%3A18Z&sr=b&sp=r&sig=MBliFg2e7DO6H9VSmog2LUPR1k%2BAEcC7lRT9aZ1Khlg%3D) 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. ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(45).png?sv=2026-02-06&spr=https&st=2026-11-24T16%3A13%3A18Z&se=2026-11-24T17%3A13%3A18Z&sr=b&sp=r&sig=8M2DWWMLsWDI7I2UwVrXhDF0Zy7d%2BoVUfkDfIXHGMLI%3D) 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 ```plaintext 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 ```plaintext ["xxxx204F"]              = "ssd0", ``` After with partition number ```plaintext ["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` ```plaintext 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 ```plaintext fmadiolua /opt/fmadio/etc/disk.lua ``` Example correct output like below ```plaintext 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 ```plaintext 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 ```plaintext 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 ```plaintext 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 ```plaintext sudo stream_dump ``` Example output looks like the following ```plaintext 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 ```plaintext lsblk ``` Output looks like the following ```plaintext 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](mailto:support@fmad.io). Scratch Disks are helpful for keeping temporary or persistant data outside of the FMADIO host capture system. Many times the OS disks are unable to be used due to capacity or location.