| 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: |
| | 62 | Here'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 | {{{ |
| | 68 | Select device |
| | 69 | 1: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB) |
| | 70 | 2: devices/\hw\sys\00:01.0\ata-c2\d0 (34.09 MB) |
| | 71 | 3: Exit |
| | 72 | }}} |
| | 73 | {{{ |
| | 74 | Choice> 1 |
| | 75 | }}} |
| | 76 | {{{ |
| | 77 | Device: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB) |
| | 78 | Disk contains no label. |
| | 79 | Entire disk: (No name) 2.097 MB, Empty |
| | 80 | Select action |
| | 81 | 1: Create label |
| | 82 | 2: Exit |
| | 83 | }}} |
| | 84 | {{{ |
| | 85 | Choice> 1 |
| | 86 | }}} |
| | 87 | {{{ |
| | 88 | Select label type |
| | 89 | 1: MBR [default] |
| | 90 | 2: GPT |
| | 91 | }}} |
| | 92 | {{{ |
| | 93 | Choice> 1 |
| | 94 | }}} |
| | 95 | {{{ |
| | 96 | Device: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB) |
| | 97 | Label type: MBR |
| | 98 | Maximum free primary block: 2.085 MB |
| | 99 | Total free primary space: 2.085 MB |
| | 100 | Select action |
| | 101 | 1: Create primary partition |
| | 102 | 2: Create extended partition |
| | 103 | 3: Delete label |
| | 104 | 4: Exit |
| | 105 | }}} |
| | 106 | {{{ |
| | 107 | Choice> 1 |
| | 108 | }}} |
| | 109 | {{{ |
| | 110 | Enter capacity of new partition. |
| | 111 | ?> 2.085 MB |
| | 112 | Select file system type |
| | 113 | 1: ExFAT |
| | 114 | 2: FAT |
| | 115 | 3: MINIX |
| | 116 | 4: Ext4 [default] |
| | 117 | }}} |
| | 118 | {{{ |
| | 119 | Choice> 4 |
| | 120 | }}} |
| | 121 | {{{ |
| | 122 | Enter volume label for new partition. |
| | 123 | }}} |
| | 124 | {{{ |
| | 125 | ?> Test |
| | 126 | }}} |
| | 127 | {{{ |
| | 128 | Enter mount point for new partition (Auto, None or /path). |
| | 129 | ?> Auto |
| | 130 | }}} |
| | 131 | {{{ |
| | 132 | Device: devices/\hw\sys\00:01.0\ata-c1\d0 (2.097 MB) |
| | 133 | Label type: MBR |
| | 134 | Partition 1: Test 2.085 MB, Primary, Ext4 |
| | 135 | Select action |
| | 136 | 1: Modify partition |
| | 137 | 2: Delete partition |
| | 138 | 3: Delete label |
| | 139 | 4: Exit |
| | 140 | }}} |
| | 141 | {{{ |
| | 142 | Choice> 4 |
| | 143 | }}} |
| | 144 | {{{ |
| | 145 | / # vol |
| | 146 | Volume Name Resource Content Auto Mounted at |
| | 147 | =========== =================================== ======== ==== =============== |
| | 148 | HelenOS-CD devices/\hw\sys\00:01.0\ata-c2\d0p0 ISO 9660 Yes /vol/HelenOS-CD |
| | 149 | Test devices/\hw\sys\00:01.0\ata-c1\d0p1 Ext4 Yes /vol/Test |
| | 150 | / # |
| | 151 | }}} |
| | 152 | |
| | 153 | == Accessing File Systems == |
| | 154 | |
| | 155 | In 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 | |
| | 157 | To find out which volumes are present in the system and where they are mounted, use the {{{vol}}} command. For example: |
| | 158 | |
| | 159 | {{{ |
| | 160 | / # vol |
| | 161 | Volume Name Resource Content Auto Mounted at |
| | 162 | =========== =================================== ======== ==== =============== |
| | 163 | devices/\hw\sys\00:01.0\ata-c1\d0p0 FAT |
| | 164 | HelenOS-CD devices/\hw\sys\00:01.0\ata-c2\d0p0 ISO 9660 Yes /vol/HelenOS-CD |
| | 165 | # |
| | 166 | }}} |
| | 167 | |
| | 168 | The partition on the internal drive is not mounted by default, but we can change that using the {{{fdisk}}} command. |
| | 169 | |
| | 170 | If 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 | |
| | 176 | To insert the volume back we can use either: |
| | 177 | |
| | 178 | {{{ |
| | 179 | # vol insert -p /vol/HelenOS-CD |
| | 180 | }}} |
| | 181 | |
| | 182 | or |
| | 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 | |
| | 192 | Typing just {{{mount<enter>}}} prints out a list of mounted |
| | 193 | file systems. The basic syntax to mount a file system is: |