[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
slackbook:working_with_filesystems [2012/09/12 21:34 (UTC)] – updated code block to syntax highlighting mfillpot | slackbook:working_with_filesystems [2012/10/24 09:40 (UTC)] (current) – [Using mount] Fixed a paragraph which was erroneously copied from the previous chapter alienbob | ||
---|---|---|---|
Line 138: | Line 138: | ||
===== Using mount ===== | ===== Using mount ===== | ||
- | Unlike other filesystems | + | Now that we've learned what (some of) the different |
- | partitions hold virtual memory. This is very useful as it prevents | + | available in Linux are, it's time we looked at how to use them. |
- | system from crashing should all your RAM be consumed. Instead, | + | In order to read or write data on a filesystem, that filesystem |
- | kernel copies portions of the RAM into swap and frees them up for other | + | must first be mounted. To do this, we (naturally) use mount(8). |
- | applications | + | The first thing we must do is decide where we want the filesystem |
- | computer, very slow virtual memory. swap is typically a fail-safe and | + | located. Recall that there are no such things are drive letters |
- | shouldn't be relied upon for continual | + | denoting filesystems in Linux. Instead, |
- | if you find yourself using lots of swap. | + | on directories. The base filesystem on which you install Slackware |
+ | is always located at ''/'' | ||
+ | subdirectories of ''/'' | ||
+ | locate a partition, so we' | ||
+ | In order to mount a filesystem' | ||
+ | kind of filesystem we have, where to mount it, and any special | ||
+ | options to use. | ||
+ | |||
+ | < | ||
+ | darkstar:~# mount -t ext3 /dev/hda3 /mnt/hd -o ro | ||
+ | </ | ||
+ | |||
+ | Let's disect this. We have an ext3 filesystem located on the third | ||
+ | partition of the first IDE device, and we've decided to mount its | ||
+ | contents on the directory /mnt/hd. Additionally, | ||
+ | read-only so no changes can be made to these contents. The [-t ext3] | ||
+ | argument tells mount what type of filesystem we are using, in this | ||
+ | case it is ext3. This lets the kernel know which driver to use. | ||
+ | Often mount can determine this for itself, but it never hurts to | ||
+ | explicitly declare it. Second, we tell mount where to locate the | ||
+ | filesystem' | ||
+ | we must decide what options to use if any. These are declared with | ||
+ | the [-o] argument. A short-list | ||
**Table 11.2. Common mount options** | **Table 11.2. Common mount options** | ||
Line 164: | Line 186: | ||
- | < | + | < |
darkstar:~# mount -t vfat /dev/hda4 /mnt/hd -o uid=alan | darkstar:~# mount -t vfat /dev/hda4 /mnt/hd -o uid=alan | ||
</ | </ | ||
Line 179: | Line 201: | ||
- | < | + | < |
darkstar:~# cat /etc/fstab | darkstar:~# cat /etc/fstab | ||
/ | / | ||
Line 195: | Line 217: | ||
- | < | + | < |
darkstar:~# mount /dev/cdrom | darkstar:~# mount /dev/cdrom | ||
darkstar:~# mount /home | darkstar:~# mount /home | ||
Line 224: | Line 246: | ||
- | < | + | < |
darkstar:~# chmod +x / | darkstar:~# chmod +x / | ||
darkstar:~# / | darkstar:~# / | ||
Line 236: | Line 258: | ||
- | < | + | < |
darkstar:~# mount -t nfs darkstar.example.com:/ | darkstar:~# mount -t nfs darkstar.example.com:/ | ||
</ | </ | ||
Line 293: | Line 315: | ||
- | < | + | < |
darkstar:~# mount -t cifs // | darkstar:~# mount -t cifs // | ||
</ | </ | ||
Line 313: | Line 335: | ||
- | < | + | < |
darkstar:~# echo " | darkstar:~# echo " | ||
darkstar:~# echo " | darkstar:~# echo " |