Fork us on GitHub Follow us on Google+ Follow us on Facebook Follow us on Twitter

Changes between Version 20 and Version 21 of UsersGuide/DisksFileSystems


Ignore:
Timestamp:
2018-12-05T10:42:51Z (11 days ago)
Author:
Jiri Svoboda
Comment:

Update for automatic volume mounting, fdisk, vol

Legend:

Unmodified
Added
Removed
Modified
  • UsersGuide/DisksFileSystems

    v20 v21  
    1414|| [wiki:Fs/Mfs MFS]       || `mfs`           || no             || yes                 || Stable ||
    1515|| [wiki:Fs/Udf UDF]       || `udf`           || no             || no                  || Read-only testing ||
     16
     17HelenOS also supports the MBR/BIOS and GPT/UEFI partitioning schemes.
    1618
    1719== Directory structure ==
     
    2931|| /srv  || server applications (services, e.g. console, networking - see the [wiki:CommandReference Command Reference]) ||
    3032|| /tmp  || temporary files ||
     33|| /w    || writable system volume (has free space, can be persistent) ||
    3134
    3235This layout is not fixed in any way and may change in the future.
     
    3740
    3841|| file_bd || File-backed block device ||
    39 || part || Disk label/partition driver - provides block devices for individual partitions ||
    4042|| rd || Initial ramdisk ||
    4143|| sata_bd || AHCI SATA ||
     44|| vbd || Virtual Block Device - provides block devices for individual partitions ||
    4245
    4346DDF-based:
     
    4750|| ddisk || msim disk driver ||
    4851
    49 == Working with disk labels and file systems ==
     52== Managing disk labels and file systems ==
    5053
    5154You can use the interactive {{{fdisk}}} utility to create and manage disk labels.
     
    5760invoking a {{{mk*fs}}} utility.
    5861
    59 == Mounting file systems ==
    60 
    61 In order to make use of a file system it needs to be mounted into the filesystem namespace
    62 using the {{{mount}}} command. Typing just {{{mount<enter>}}} prints out a list of mounted
    63 file systems. Te basic syntax to mount a file system is:
     62Here's an example {{{fdisk}}} session where we create a new partition table, create one partition with and Ext4 file system labeled 'Test' that will be automatically mounted at {{{/vol/Test}}}. Note that in several cases we just hit enter and go with the default choice.
     63
     64{{{
     65/ # fdisk
     66}}}
     67{{{
     68Select device
     691: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB)
     702: devices/\hw\sys\00:01.0\ata-c2\d0 (34.09 MB)
     713: Exit
     72}}}
     73{{{
     74Choice> 1
     75}}}
     76{{{
     77Device: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB)
     78Disk contains no label.
     79Entire disk: (No name) 2.097 MB, Empty
     80Select action
     811: Create label
     822: Exit
     83}}}
     84{{{
     85Choice> 1
     86}}}
     87{{{
     88Select label type
     891: MBR [default]
     902: GPT
     91}}}
     92{{{
     93Choice> 1
     94}}}
     95{{{
     96Device: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB)
     97Label type: MBR
     98Maximum free primary block: 2.085 MB
     99Total free primary space: 2.085 MB
     100Select action
     1011: Create primary partition
     1022: Create extended partition
     1033: Delete label
     1044: Exit
     105}}}
     106{{{
     107Choice> 1
     108}}}
     109{{{
     110Enter capacity of new partition.
     111?> 2.085 MB
     112Select file system type
     1131: ExFAT
     1142: FAT
     1153: MINIX
     1164: Ext4 [default]
     117}}}
     118{{{
     119Choice> 4
     120}}}
     121{{{
     122Enter volume label for new partition.
     123}}}
     124{{{
     125?> Test
     126}}}
     127{{{
     128Enter mount point for new partition (Auto, None or /path).
     129?> Auto
     130}}}
     131{{{
     132Device: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB)
     133Label type: MBR
     134Partition 1: Test 2.085 MB, Primary, Ext4
     135Select action
     1361: Modify partition
     1372: Delete partition
     1383: Delete label
     1394: Exit
     140}}}
     141{{{
     142Choice> 4
     143}}}
     144{{{
     145/ # vol
     146Volume Name Resource                            Content  Auto Mounted at     
     147=========== =================================== ======== ==== ===============
     148HelenOS-CD  devices/\hw\sys\00:01.0\ata-c2\d0p0 ISO 9660 Yes  /vol/HelenOS-CD
     149Test        devices/\hw\sys\00:01.0\ata-c1\d0p1 Ext4     Yes  /vol/Test     
     150/ #
     151}}}
     152
     153== Accessing File Systems ==
     154
     155In many cases the OS makes file systems available automatically. For any file system that has a volume label and is not located on the internal ATA disk drive, it should be automatically available under {{{/vol/<volume_label>}}}. This works for CD-ROMS and USB flash sticks, for example.
     156
     157To find out which volumes are present in the system and where they are mounted, use the {{{vol}}} command. For example:
     158
     159{{{
     160/ # vol
     161Volume Name Resource                            Content  Auto Mounted at     
     162=========== =================================== ======== ==== ===============
     163            devices/\hw\sys\00:01.0\ata-c1\d0p0 FAT                         
     164HelenOS-CD  devices/\hw\sys\00:01.0\ata-c2\d0p0 ISO 9660 Yes  /vol/HelenOS-CD
     165#
     166}}}
     167
     168The partition on the internal drive is not mounted by default, but we can change that using the {{{fdisk}}} command.
     169
     170If you would like to remove a volume from the system, use the {{{vol eject }}} command:
     171
     172{{{
     173# vol eject /vol/HelenOS-CD
     174}}}
     175
     176To insert the volume back we can use either:
     177
     178{{{
     179# vol insert -p /vol/HelenOS-CD
     180}}}
     181
     182or
     183
     184{{{
     185# vol insert devices/\hw\sys\00:01.0\ata-c2\d0p0
     186}}}
     187
     188== Mounting file systems manually ==
     189
     190'''This should only be needed in special circumstances. In most cases use {{{fdisk}}} to configure the mount point. Only do this if you know what you are doing as it may break the system's idea of file system status.'''
     191
     192Typing just {{{mount<enter>}}} prints out a list of mounted
     193file systems. The basic syntax to mount a file system is:
    64194
    65195{{{