OC Tutorial: Hard Drives ================= When [[tutorial:oc2_writing_code|writing programs]] you'll usually want to have your programs stick around, so the `/tmp` folder is no long-term solution. Enter [[item:hdd|hard drives]]. When you put a hard drive into a computer it will be automatically mounted in the `/mnt` folder, named after the first letters of its address. While this may be enough for experimenting, you'll want more flexibility and comfort after a while. This tutorial will introduce the concept of labeling and mounting hard drives. *Note*: all concepts in this tutorial also apply to [[item:floppy|floppy disks]]. First, insert a fresh hard drive into a computer: {{https://i.imgur.com/Nr81Dx2.png?700}} You'll notice in the tooltip of the hard drive that it has been assigned an address (that shortened, alpha-numeric string). You don't have to remember that, it's just there for reference. Next, open the screen's GUI and type `df`. This program lists all present file systems and their current mount points. Among them you'll notice one that's only known by address (unlike the ROM and temporary file system). That should be the address you saw in the tooltip, earlier. {{https://i.imgur.com/22yfaRh.png?700}} What we want to do now, is to assign a name to our hard drive, so we don't have to reference it by address all the time. Run `label` to get the usage information of the labeling program. We'll use the `-a` option here, but you could also label it by providing the path to its default mount point in the `/mnt` folder. Run the program with the desired parameters, i.e. name the disk as you'd like. Note that the `92a` in the screen shot is the beginning of the hard drive's address. For most programs that need an address you can abbreviate the address, as long as it's still unique among the other components connected to the computer. Once you've named your hard disk that name is also shown in the hard disk's tooltip. Run `df` again to verify the hard disk is now named: {{https://i.imgur.com/X1ws656.png?700}} We can now mount the hard drive while referring to it by name. Type `mount