This is available at the shell by running the help command.

Sector Editing/Reading/Etc

Sector and User Status

Other Useful Commands

Sector Graphics

Sector Editing/Reading/Etc



Usage: se sector_number

Edit one of your owned sectors. Note that this will cache the sector to the hard disk before writing it to the floppy, so depending on disk activity it may take a moment for the sector to be available with sr.

Note that you can also edit your sectors with any other hex editor or editing program, and you can download/upload them using sftp with your shell login. For more information about the hexedit* program used on this system, run the command man hexedit.

Also note that any sector file larger than 512 bytes will be truncated. If you want to distribute a file across multiple sectors, see sdist.


Ctrl-X        Prompt to save & quit
Ctrl-C        Quit without saving
Tab        Switch between Hex/ASCII
Ctrl-T        Truncate file to cursor
Enter        Goto Location (Hex)



Usage: sr [-o] s1 [s2 ...]

This will read one or more sectors directly from the floppy disk (this is different from reading the cached sector files in your ~/sectors directory). This command uses dd to read the raw contents of the drive and hexdump to display it.

You can achieve the same effect by using the following command:

dd if=/floppy bs=512 count=1 skip=sector_number | hexdump -C


-o     Print to stdout instead of a pager



Usage: s0 sector_number

This will zero out (delete all of the data) on one of your owned sectors. This action is not reversible, so if you want a backup of your sectors first, make one.

This is effectively the same as the command

dd if=/dev/zero of=/floppy bs=512 count=1 seek=sector_number

However, note that users do not have direct write access to the disk, so they must use the s0 command to zero out their cached sector files first before the changes are applied. (This is to prevent anyone from overwriting the entire disk).

If you really want to zero out more than one sector without confirmation, here are some examples on how to do so:

EXAMPLE ONE: Delete sectors x, y, and z:

for i in (x y z); do yes | s0 $i; done

EXAMPLE TWO: Delete sectors a-z:

for i in {a..z}; do yes | s0 $i; done

EXAMPLE THREE: Delete sectors a-c and x-z:

for i in {a..z} {x..z}; do yes | s0 $i; done

NOTE: Please DO NOT delete the files in your ~/sector directory! They are symbolic links to your owned sectors in /usr/share/sectors. If you DO end up deleting one by accident, run the command repop-sectors to repopulate your sector directory.



Usage: smov sector_1 sector_2

Swap two owned sectors. If you would like to clear one of the sectors after the swap, use in combination with the s0 command.

If you want to copy one sector across multiple instead of swapping, use the scopy command.



Usage: scopy s1 s2 [s3 ...]

This command allows you to copy the contents of one sector to one or more owned sectors. You can copy any sector so long as it is either claimed, non-empty, or both. (You cannot copy empty unclaimed sectors; use s0 for that).

If you want to simply swap sectors around, use smov.



Usage: sdist input_file s1 [s2 ...]

Distribute a file across multiple sectors. This command is useful in the case that you have a file larger than one sector that you would like to place on the disk. It will be written in the order of the named sectors, so keep this in mind.

If the file is larger than the combined size of the named sectors, the program will ask you if you would like to truncate (short-stop) the file. Likewise, if it does not require all of the named sectors, the program will ask if you still want to overwrite all sectors (where empty space will be zeroed) or the minimum number required. Note that it is impossible to have zero data on a physical disk, so any leftover space will be filled with 00 hex.

(Beta note: I am planning on adding functionality to redownload a perfect copy of the original file by allowing users who own multiple sectors to have a definition sector for distributed files. There is no filesystem on the floppy disk).

Sector and User Status



Usage: available [-o | -? | sector]

Lists all available sectors. If sector numbers are specified, tells you if those sectors are available or not.


-o      Print to stdout instead of a pager
-?      Get usage info
sector  Check if [sector] is available

For the sake of scripting, if one uses the [sector] parameter, the program will exit successfully (exit code 0) if the sector is available, and unsuccessfully (exit code 1) if it is not. (Keep in mind, exit code 1 is also used for general errors, but hopefully this will help somebody writing a script to see if multiple sectors are available or not).

A list of available sectors is available on the web here.



Usage: abandoned

Lists sectors that have been abandoned by users.

Despite warnings by well-meaning oldsters that "things you put on the internet will never disappear", they sometimes do. After all, I, the sysadmin, could slam my finger into the eject button propelling the disk this system relies on out into the open air of my home. I could take a magnet to it, or if I'm feeling extreme, a degaussing device and wipe away every precious bit of data you've written to it, as I laugh maniacally, knowing good and well I've destroyed the 512-byte hopes and dreams of a thousand helpless souls.

But, I wouldn't do that. In fact, this command is evidence to my dedication to data-hoarding.

If a user's account gets terminated or for whatever reason sectors are given up, the content on them doesn't simply disappear. Oh no, no, no, dear user; this is the INTERNET where, as educational VHS's might tell you, nothing EVER goes away! Unless the content on the sector happens to be wildly inappropriate (let's say a particularly unethical password dump, a post meant to bully another user, or even--dare I say it, for the weak may faint and the strong become ill--a suggestion that NES games should be played in 16:9), it shall remain to be reclaimed. When another user ultimately reclaims it, they will inherit the content, with which they may do whatever they want.

Note that abandoned sectors with zero content (literally, all 0x00's), will be removed from the hard disk cache and simply appear as unclaimed. This is largely so that users can make use of this command (abandoned, if you've forgotten), to look through content that now belongs to no one.

If you want to read all abandoned sectors using just one command, you can do so like this:

abandoned | xargs sr



Usage: quota

Display user's maximum allowed disk space usage. (See man quota for detailed usage of this command. This is not a custom command, but it warrants some explanation here).

To ensure the VM doesn't totally run out of room (and to be sure that users don't just mass-upload files or upload ridiculously large files - after all, the whole floppy disk is just 1.44MB), user disk quotas are set on this system. This command will output something akin to the following:

Disk quotas for user fdiskquota (uid 1007):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
      /dev/sdb1       0   14400   14400               1       0       0

The important things here are the first 'blocks', 'quota', and 'limit' columns. The 'blocks' entry represents how many 1K blocks of storage you've used on the system. 'Quota' is the soft limit (in 1K blocks) of your disk usage (it'll give you a warning that you're out of space), and 'limit' is the hard limit (it'll mean it). The user directories under /home are on a different device than the cached sectors in /usr/share/sectors, so even if you owned all 2880 sectors on the disk, it shouldn't affect your intended user limit (although you might lose a couple of K to directory and filesystem information).

In the example above, the user is allowed 14400K (TEN floppy disks!) of storage. If, for whatever reason, the default isn't enough (say you've got some hefty user scripts or even just a good chunk of image files you want to turn into sectors), just message me (jebug29, the sysadmin, jebug29[at]sectordisk.pw), and ask about increasing your storage. I don't mind at all if one or two users want to use a bit more -- even double or triple -- just be mindful of the other users on the system and my own limited disk space! ;)

Other Useful Commands



Usage: repop-sectors

This command repopulates the symbolic links in the user's sector directory. It simply checks for what files you have write access to in /usr/share/sectors and makes the links.

If you want to zero out the data in a sector, use the s0 command. DON'T delete the sector file.



Usage: commands

Gives a quick list of editing commands and their basic usage strings.

See help (aren't you already here?) for more commands and more detailed explanations about how they all work. COMMANDS DOES NOT CONTAIN EVERY SECTOR DISK-SPECIFIC COMMAND BUT HELP DOES!!



Usage: help [command]

Get a list of all commands along with detailed explanations about how each works and how to use them. Various usage examples are also available (i.e. how to zero out more than one sector (see help s0)).

A quick list of commands is also available with the commands command.

Sector Graphics

This tutorial may be more helpful for this section.



Usage: png2sector sector input_file.png

This allows you to apply the image data of a properly-paletted PNG file to an owned sector. (Technically it will work even if it isn't properly paletted, but that's no fun!)

You can reverse this process using the sector2png command, and you can view the image in a 256-color shell using the colors command!

See the tutorial here for more information and a better guide to creating your own raster sectors! There's also a video tutorial available if that would be more helpful to you.



Usage: sector2png sector output_file.png

Produces a paletted image file of the graphic representation of a given sector. You can preview what this will look like using the colors command.



Usage: colors s1 [s2 ...]

Produces a visual representation directly in the terminal using the xterm color palette. It's cool!

Back to Top