Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tutorial:oc3_hard_drives [2016/02/17 21:11]
rakiru Fix grammatical error
tutorial:oc3_hard_drives [2018/01/15 20:44] (current)
paparadva Updated screenshots
Line 7: Line 7:
 First, insert a fresh hard drive into a computer: First, insert a fresh hard drive into a computer:
  
-{{http://​i.imgur.com/​QQN9M79.png?700}}+{{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. 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.
  
-{{http://​i.imgur.com/​xFCHvVY.png?700}}+{{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. 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 `339` 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.+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: 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:
  
-{{http://​i.imgur.com/​LBISUE0.png?700}}+{{https://​i.imgur.com/​X1ws656.png?700}}
  
 We can now mount the hard drive while referring to it by name. Type `mount <​label>​ <​path>​` to mount the hard drive with the specified label at the specified path. Hard drives can be mounted in multiple locations, so doing that will not invalidate the default mount in the `/mnt` folder. We can now mount the hard drive while referring to it by name. Type `mount <​label>​ <​path>​` to mount the hard drive with the specified label at the specified path. Hard drives can be mounted in multiple locations, so doing that will not invalidate the default mount in the `/mnt` folder.
Line 26: Line 26:
 Switch into your freshly mounted folder, and run `edit autorun.lua`. Switch into your freshly mounted folder, and run `edit autorun.lua`.
  
-{{http://​i.imgur.com/​vmhRhLs.png?700}}+{{https://​i.imgur.com/​QYgrS3z.png?700}}
  
 Autorun scripts get the proxy of the storage medium they'​re on as their first parameter, so we can use Lua's varargs syntax to access it. We'll pass that to the `fs.mount()` function, which you find documented in [[api:​filesystem|the file system API]]. Autorun scripts get the proxy of the storage medium they'​re on as their first parameter, so we can use Lua's varargs syntax to access it. We'll pass that to the `fs.mount()` function, which you find documented in [[api:​filesystem|the file system API]].
  
-{{http://​i.imgur.com/​pfXbxI4.png?700}}+{{https://​i.imgur.com/​J5inxhI.png?700}}
  
 Save that file and close it. After removing the hard disk from the computer and inserting it again, run `ls` and you should see the disk has been automatically mounted again. Save that file and close it. After removing the hard disk from the computer and inserting it again, run `ls` and you should see the disk has been automatically mounted again.
  
-{{http://​i.imgur.com/​dMuEvEi.png?700}}+{{https://​i.imgur.com/​Us0kTvl.png?700}}
  
 Contents Contents
 ------------ ------------
 {{page>​tutorial:​contents&​noheader&​noeditbutton&​nouser&​nofooter}} {{page>​tutorial:​contents&​noheader&​noeditbutton&​nouser&​nofooter}}