{"id":21515708,"url":"https://github.com/goblinhack/fatdisk","last_synced_at":"2025-04-09T20:12:36.336Z","repository":{"id":17482245,"uuid":"20263591","full_name":"goblinhack/fatdisk","owner":"goblinhack","description":"C code utility to modify DOS disks in place without mounting","archived":false,"fork":false,"pushed_at":"2021-03-03T08:51:41.000Z","size":149,"stargazers_count":11,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T20:12:29.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goblinhack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-28T15:57:35.000Z","updated_at":"2024-12-19T05:33:28.000Z","dependencies_parsed_at":"2022-08-30T08:50:51.530Z","dependency_job_id":null,"html_url":"https://github.com/goblinhack/fatdisk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goblinhack%2Ffatdisk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goblinhack%2Ffatdisk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goblinhack%2Ffatdisk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goblinhack%2Ffatdisk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goblinhack","download_url":"https://codeload.github.com/goblinhack/fatdisk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T23:56:28.452Z","updated_at":"2025-04-09T20:12:36.312Z","avatar_url":"https://github.com/goblinhack.png","language":"C","readme":"fatdisk\n=======\n\nfatdisk is a utility that allows you to perform various operations on files\non a DOS formatted disk image in FAT12,16,32 formats without needing to do any\nmounting of the disk image, or needing root or sudo access.\n\nIt can extract files from the DOS disk to the local harddrive, and likewise\ncan import files from the local disk back onto the DOS disk. Additionally\nyou can do basic operations like list, cat, hexdump etc...\n\nLastly this tool can also format and partition a disk, setting up the FAT\nfilesystem and even copying in a bootloader like grub. This is a bit \nexperimental so use with care.\n\nYou may specify the partition of the disk the tool is to look for, but it\nwill default to partition 0 if not. And if no partition info is found, it\nwill do a hunt of the disk to try and find it.\n\nUsage: fatdisk [OPTIONS] disk-image-file [COMMAND]\n\nCOMMAND are things like extract, rm, ls, add, info, summary, format.\nOptions:\n        --verbose        : print lots of disk info\n        -verbose         :\n        -v               :\n\n        --quiet          : print less info when adding/removing\n        -quiet           :\n        -q               :\n\n        --debug          : print internal debug info\n        -debug           :\n        -d               :\n\n        --offset         : offset to start of disk\n        -offset          : e.g. -o 32256, -o 63s -o 0x7e00\n        -o               :\n\n        --partition      : partition to use\n        -partition       :\n        -p               :\n\n        --sectors_per_cluster : sectors per cluster\n        -sectors_per_cluster  :\n        -S               :\n\n        --sectorsize     : default 512\n        -sectorsize      :\n\n        --help           : this help\n        -help            :\n        -h               :\n\n        --version        : tool version number\n        -version         :\n        -ver             :\n\nCommands:\n\n        info             : print disk info\n        i                :\n\n        summary          : print disk info summary\n        sum              :\n        s                :\n\n        list      \u003cpat\u003e  : list a file or dir\n        ls        \u003cpat\u003e  :\n        l         \u003cpat\u003e  :\n\n        find      \u003cpat\u003e  : find and raw list files\n        fi        \u003cpat\u003e  :\n        f         \u003cpat\u003e  :\n\n        extract   \u003cpat\u003e  : extract a file or dir\n        x         \u003cpat\u003e  :\n\n        add       \u003cpat\u003e  : add a file or dir, keeping same\n        a         \u003cpat\u003e  : full pathname on the disk image\n\n        fileadd   local-name [remote-name]\n                         : add a file with a different name from source\n        f         \u003cpat\u003e  :\n\n        remove    \u003cpat\u003e  : remove a file or dir\n        rm        \u003cpat\u003e  :\n        r         \u003cpat\u003e  :\n\n        hexdump          : include hex dump of files\n        hex              :\n        h                :\n\n        cat              : raw dump of file to console\n        ca               :\n        c                :\n\n        format\n               size xG/xM\n               [part 0-3]           select partiton\n               [zero]               zero sectors\n               [bootloader \u003cfile\u003e]  install bootloader\n               [\u003cdisktype\u003e]         select filesys type\n               where \u003cdisktype\u003e is: Empty FAT12 XENIX-root XENIX-usr Small-FAT16 Extended FAT16 HPFS/NTFS AIX AIX-bootable OS/2-boot-mgr FAT32 FAT32-LBA FAT16-LBA Extended-LBA OPUS Hidden-FAT12 Compaq-diag Hidd-Sm-FAT16 Hidd-FAT16 Hidd-HPFS/NTFS AST-SmartSleep Hidd-FAT32 Hidd-FAT32-LBA Hidd-FAT16-LBA NEC-DOS Plan-9 PMagic-recovery Venix-80286 PPC-PReP-Boot SFS QNX4.x QNX4.x-2nd-part QNX4.x-3rd-part OnTrack-DM OnTrackDM6-Aux1 CP/M OnTrackDM6-Aux3 OnTrack-DM6 EZ-Drive Golden-Bow Priam-Edisk SpeedStor GNU-HURD/SysV Netware-286 Netware-386 DiskSec-MltBoot PC/IX Minix-\u003c1.4a Minix-\u003e1.4b Linux-swap Linux OS/2-hidden-C: Linux-extended NTFS-volume-set NTFS-volume-set Linux-plaintext Linux-LVM Amoeba Amoeba-BBT BSD/OS Thinkpad-hib FreeBSD OpenBSD NeXTSTEP Darwin-UFS NetBSD Darwin-boot BSDI-fs BSDI-swap Boot-Wizard-Hid Solaris-boot Solaris DRDOS/2-FAT12 DRDOS/2-smFAT16 DRDOS/2-FAT16 Syrinx Non-FS-data CP/M/CTOS Dell-Utility BootIt DOS-access DOS-R/O SpeedStor BeOS-fs EFI-GPT EFI-FAT Lnx/PA-RISC-bt SpeedStor DOS-secondary SpeedStor Lnx-RAID-auto LANstep \n\nExamples:\n\n  $ fatdisk mybootdisk ls\n    ----daD            0       2013 Jan 02   locale/             LOCALE\n    -----aD        18573       2013 Jan 02    ast.mo             AST.MO\n    ...\n\n  $ fatdisk mybootdisk info\n\n  $ fatdisk mybootdisk summary\n\n  $ fatdisk mybootdisk extract dir\n\t\t\t\t\t-- dumps dir to the local disk\n  $ fatdisk mybootdisk rm dir\n\t\t\t\t\t-- recursively remove dir\n  $ fatdisk mybootdisk rm dir/*/*.c\n\t\t\t\t\t-- selectively remove files\n  $ fatdisk mybootdisk add dir\n\t\t\t\t\t-- recursively add dir to the disk\n  $ fatdisk mybootdisk hexdump foo.c\n\t\t\t\t\t-- dump a file from the disk\n\n  $ fatdisk mybootdisk format size 1G name MYDISK part 0 50% \\\n      bootloader grub_disk part 1 50% fat32 bootloader grub_disk\n\n\t\t\t\t\t-- create and format a 1G disk\n\t\t\t\t\t   with 2 FAT 32 partitions and grub\n\t\t\t\t\t   installed in sector 0 of part 0\n\nWritten by Neil McGill, goblinhack@gmail.com, with special thanks\nto Donald Sharp, Andy Dalton and Mike Woods\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoblinhack%2Ffatdisk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoblinhack%2Ffatdisk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoblinhack%2Ffatdisk/lists"}