This shows you the differences between two versions of the page.
|
ep:labs:05:contents:tasks:ex2 [2026/03/30 20:25] radu.mantu |
ep:labs:05:contents:tasks:ex2 [2026/03/30 22:16] (current) radu.mantu |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== 02. [30p] RAM disk ==== | + | ==== 02. [20p] RAM disk ==== |
| Linux allows you to use part of your RAM as a block device, viewing it as a hard disk partition. The advantage of using a RAM disk is the **extremely low latency** (even when compared to SSDs). The disadvantage is that all contents will be lost after a reboot. | Linux allows you to use part of your RAM as a block device, viewing it as a hard disk partition. The advantage of using a RAM disk is the **extremely low latency** (even when compared to SSDs). The disadvantage is that all contents will be lost after a reboot. | ||
| Line 7: | Line 7: | ||
| * **tmpfs** - newer than **ramfs**. Can set a size limit. Behaves exactly like a hard disk partition but can't be monitored through conventional means (i.e. **iostat**). Size can be precisely estimated using **df**. | * **tmpfs** - newer than **ramfs**. Can set a size limit. Behaves exactly like a hard disk partition but can't be monitored through conventional means (i.e. **iostat**). Size can be precisely estimated using **df**. | ||
| </note> | </note> | ||
| - | === [15p] Task A - Create RAM Disk === | + | === [10p] Task A - Create RAM Disk === |
| Before getting started, let's find out the file system that our root partition uses. Run the following command (T - print file system type, h - human readable): | Before getting started, let's find out the file system that our root partition uses. Run the following command (T - print file system type, h - human readable): | ||
| Line 44: | Line 44: | ||
| That's it. We just created a 1Gb **tmpfs** ramdisk with an **ext4** file system and mounted it at ///mnt/ramdisk//. Use **df** again to check this yourself. | That's it. We just created a 1Gb **tmpfs** ramdisk with an **ext4** file system and mounted it at ///mnt/ramdisk//. Use **df** again to check this yourself. | ||
| - | === [15p] Task B - Pipe View & RAM Disk === | + | === [10p] Task B - Pipe View & RAM Disk === |
| As we mentioned before, you can't get I/O statistics regarding **tmpfs** since it is not a real partition. One solution to this problem is using **pv** to monitor the progress of data transfer through a pipe. This is a valid approach only if we consider the disk I/O being the bottleneck. | As we mentioned before, you can't get I/O statistics regarding **tmpfs** since it is not a real partition. One solution to this problem is using **pv** to monitor the progress of data transfer through a pipe. This is a valid approach only if we consider the disk I/O being the bottleneck. | ||
| Line 56: | Line 56: | ||
| Look at the elapsed time and average transfer speed. What conclusion can you draw? | Look at the elapsed time and average transfer speed. What conclusion can you draw? | ||
| - | |||
| - | :!: Put one screenshot with the tmpfs partition in df output and one screenshot of both pv commands and write your conclusion. | ||
| - | |||