{"id":2096,"date":"2026-06-06T19:28:04","date_gmt":"2026-06-06T19:28:04","guid":{"rendered":"https:\/\/wordpress.hertell.nu\/?p=2096"},"modified":"2026-06-06T19:28:05","modified_gmt":"2026-06-06T19:28:05","slug":"diskpart-the-cli-script-guide","status":"publish","type":"post","link":"https:\/\/wordpress.hertell.nu\/?p=2096","title":{"rendered":"DiskPart The CLI \/ Script guide"},"content":{"rendered":"\n<p>If you missed it.  This is for DiskPart for Amiga.   <a href=\"https:\/\/github.com\/ChuckyGang\/DiskPart\">https:\/\/github.com\/ChuckyGang\/DiskPart<\/a>  <\/p>\n\n\n\n<p>Even if you can do all in the GUI. This is a small guide how to use the CLI instead.<\/p>\n\n\n\n<p>If you start it without any arguments it will start with GUI.  if you use the argument NOWARNING it will start the GUI WITHOUT the beta warning.<\/p>\n\n\n\n<p>DiskPart ?<br><br>Will give you a summary of commandlines options:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-23-scaled.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"55\" src=\"https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-23-1024x55.png\" alt=\"\" class=\"wp-image-2097\" srcset=\"https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-23-1024x55.png 1024w, https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-23-300x16.png 300w, https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-23-768x41.png 768w, https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-23-1536x82.png 1536w, https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-23-2048x110.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>However from now in in this guide. I will not use screenshots from the Amiga.  I Will instead show all commands as <strong>BOLD<\/strong> text<\/p>\n\n\n\n<p><strong>DiskPart LISTDEV<\/strong><\/p>\n\n\n\n<p>This will just show the devices same as what the GUI shows.<\/p>\n\n\n\n<p><strong>DiskPart LISTDEV UNITS<\/strong><\/p>\n\n\n\n<p>This is the same except it also shows the devices in each dev.  Remember that this can show some &#8220;false positives&#8221; if the device handler actually can list a device even it might not be a harddrive.<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 INFO<\/strong><\/p>\n\n\n\n<p>This will show the RDB Info on device 3 on uaehf.device<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-24.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"222\" src=\"https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-24-1024x222.png\" alt=\"\" class=\"wp-image-2098\" srcset=\"https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-24-1024x222.png 1024w, https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-24-300x65.png 300w, https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-24-768x167.png 768w, https:\/\/wordpress.hertell.nu\/wp-content\/uploads\/2026\/06\/image-24.png 1244w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><strong>DiskPart DEV scsi.device:0 SMART<\/strong><\/p>\n\n\n\n<p>IF Your device supports it, it will show SMART Data from that disk.<\/p>\n\n\n\n<p>You can also use IMAGES instead of a device:<\/p>\n\n\n\n<p><strong>DiskPart IMAGE test.hdf INFO<\/strong><\/p>\n\n\n\n<p><strong>DiskPart IMAGE fresh.hdf CREATE SIZE=100M<\/strong><\/p>\n\n\n\n<p>Will create a 100MB Image.  REMEMBER. This is dependent on the filesystem of your disk if larger files can be used!<\/p>\n\n\n\n<p>Anyway.  Lets do the real stuff!<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 INIT NEW<\/strong><\/p>\n\n\n\n<p>This will init the RDB on your device 3 at uaehf.device. IF you add a <strong>FORCE<\/strong><\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 INIT NEW FORCE<\/strong><\/p>\n\n\n\n<p>It will not ask. it will just do it!  and this is for all commands!  adding FORCE will answer YES on all questions so be very sure what you do with FORCE<\/p>\n\n\n\n<p>if you have written a 1GB image to your 4GB device. you usually cannot use the extra 3GB.<br>but with:<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 INIT NEWGEO FORCE<\/strong><\/p>\n\n\n\n<p>It will read the new geometry and write it to the disk so you can use the extra space<\/p>\n\n\n\n<p>Now we maybe want to add things:<\/p>\n\n\n\n<p>First Filesystems:<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 ADDFS TYPE=PFS3 FILE=L:pfs3aio<\/strong><\/p>\n\n\n\n<p>This will add the pfs3aio filesystem with dostype PFS3.  you can also use hexvalues if you want to.<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 ADDPART NAME=DH0 LOW=START HIGH=+100M TYPE=PFS3 BOOTABLE<\/strong><\/p>\n\n\n\n<p>This will add a Partition with the devicename DH0  Starting at first abailble space and will be 100MB.  Using filesystem PFS3  and marked Bootable.<\/p>\n\n\n\n<p>If you set HIGH=END  it will use all available space.<br>If you set  LOW=300M  it will start at 300M<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 ADDPART NAME=DH0 LOW=START HIGH=+100M TYPE=PFS3 BLOCKSIZE=1024  BOOTABLE<\/strong><\/p>\n\n\n\n<p>This will create it with a blocksize of 1024.<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 ADDPART NAME=DH0 LOW=START HIGH=+100M TYPE=PFS3 BLOCKSIZE=1024  VOLNAME=MyVol BOOTABLE<\/strong><\/p>\n\n\n\n<p>This will also Format the disk with name MyVol!  IMPORTANT NOTE: As filesystem is loaded at boot. if you havent had any filesystem on any disk at boottime, this format MIGHT fail as it is a PFS3.  reboot and it will work.<\/p>\n\n\n\n<p>IF you have a size of  say 100M and you only have 30M free at that location, partition will be set to 30MB unless you add a ENFORCESIZE at the end.  then it will fail instead<\/p>\n\n\n\n<p><br>The biggest feature..  the GROW function:<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 GROW DH1 100M<\/strong><\/p>\n\n\n\n<p>This will look for the DH1 partition and grow it with 100MB<\/p>\n\n\n\n<p>You cannot have any open files on this partition but if no problems it will unmount the partition grow it and mount it again.<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 GROW DH1 END<\/strong><\/p>\n\n\n\n<p>This will grow the partition to the end of the disk. (or available space)<\/p>\n\n\n\n<p>RDB Blocks can sometimes be corrupted. This is why a backup can be a good thing to have:<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 BACKUP ram:rdb.back<\/strong><\/p>\n\n\n\n<p>This backups the RDB to rdb.back.<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 RESTORE ram:rdb.back<\/strong><\/p>\n\n\n\n<p>This restores the file.<\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 BACKUPEXT ram:rdb.back<\/strong><\/p>\n\n\n\n<p><strong>DiskPart DEV uaehf.device:3 RESTOREEXT ram:rdb.back<\/strong><\/p>\n\n\n\n<p>This is the same as above but extended, meaning it also backups the filesystems etc.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>SCRIPTING! we also supports scripts so no need to load DiskPart a gazillion of times.<\/p>\n\n\n\n<p>Make a scriptfile:<\/p>\n\n\n\n<p>say RAM:Scriptfile.txt<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Initialise uaehf.device unit 0\nOPEN uaehf.device 0\nINIT NEW\nADDFS TYPE=DOS3 FILE=L:pfs3aio\nADDPART NAME=DH0 LOW=2 HIGH=511 TYPE=DOS3 BOOTPRI=0\nADDPART NAME=DH1 LOW=512 HIGH=1023 TYPE=PDS3\nWRITE\n\n<\/code><\/pre>\n\n\n\n<p>And Start DiskPart with:<\/p>\n\n\n\n<p><strong>DiskPart SCRIPT RAM:Scriptfile.txt<\/strong><\/p>\n\n\n\n<p>It will run it.    if you do:<\/p>\n\n\n\n<p><strong>DiskPart SCRIPT RAM:Scriptfile.txt DRYRUN<\/strong><\/p>\n\n\n\n<p>It will run the script.  but never execute anything good for testing<\/p>\n\n\n\n<p><strong>DiskPart SCRIPT RAM:Scriptfile.txt FORCE<\/strong><\/p>\n\n\n\n<p>This will run everything WITHOUT ASKING QUESTIONS! it will just do it<\/p>\n\n\n\n<p>more or less all commands from CLI can be run in script.<\/p>\n\n\n\n<p>If you look at the DiskPart archive you will find all documentation you need for CLI and Scripting.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>THIS IS A WORK IN PROGRESS AND CAN BE CHANGED!<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you missed it. This is for DiskPart for Amiga. https:\/\/github.com\/ChuckyGang\/DiskPart Even if you can do all in the GUI&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2096","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=\/wp\/v2\/posts\/2096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2096"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=\/wp\/v2\/posts\/2096\/revisions"}],"predecessor-version":[{"id":2099,"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=\/wp\/v2\/posts\/2096\/revisions\/2099"}],"wp:attachment":[{"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.hertell.nu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}