If we don't have the space on our drive for a new swap partition we might need to create a swap file. A swap file is slower than a partition so it's not always desirable. However, a swap file may be a good temporary solution to needing more virtual memory.
- [Male Instructor] A Windows style swap file is possible…in Linux, although not always desirable.…Accessing a swap file takes longer than accessing…a raw partition, making it slower.…The reason we may want to create a swap file…is flexibility.…We may not have any free space on our drive…to create a new partition for swap.…In this case, we would create a new logical…volume and make it swap.…If that's not possible, then creating a swap file…is our only choice.…Due to the slower speed, a swap file…should always have a lower priority than…a swap partition.…
Let's check to see how much free space…we have on our root drive.…In a Terminal, type in "df -H" and hit Enter.…It looks like we have about 1.8 gigabytes of free space…Let's create a 500 megabyte swap file.…We'll create this using DD.…Type in "Clear" and then type in "sudo dd if=/dev/zero"…as our input file.…Space "of=/swapfile" is the name of the swap file.…
Space "count=1 bs=500MiB".…This is the block size.…And hit Enter.…Type in your password if prompted.…If you want to create a larger swap file,…
Author
Updated
5/1/2019Released
4/9/2018Note: This course also helps you study to pass the Red Hat Certified Engineer (RHCE) exam—the benchmark certification for Red Hat Enterprise Linux.
- Create partitions
- Backing up the partition table
- Resize partitions
- Managing LVM volumes
- Creating LVM rollback and roll-forward snapshots
- Extending and shrinking LVM volume groups
- Replacing physical volumes in LVM volume groups
- Creating Linux file systems
- Managing swap
- Creating RAID arrays using LVM
- Backing up and restoring files and file systems
Skill Level Advanced
Duration
Views
Related Courses
-
Setting up a Red Hat Enterprise Linux Server
with Sandra Toner2h 46m Intermediate -
Linux: Desktops and Remote Access
with Grant McWilliams1h 44m Intermediate
-
Introduction
-
What you should know1m 21s
-
OS installation9m 50s
-
Lab setup5m 41s
-
Install Guest Additions4m 22s
-
1. Manage and Partition Disks
-
Backup the partition table3m 32s
-
2. Manage Logical Volumes
-
Replace a physical volume3m 58s
-
3. Use Logical Volume Snapshots
-
About LVM snapshots3m 13s
-
-
4. Manage Linux File Systems
-
Create EXT file systems3m 25s
-
Migrate EXT3 to EXT42m 26s
-
Repair EXT file systems4m 55s
-
EXT optimizations5m 50s
-
Using System Storage Manager4m 34s
-
-
5. Manage Swap
-
Create temporary swap files2m 25s
-
Change system swapiness2m 22s
-
6. Create RAID arrays
-
MDRAID or DMRAID?1m 43s
-
Create an LVM RAID 13m 43s
-
Create an LVM RAID 54m 10s
-
-
7. Back Up and Restore
-
Archive files4m 41s
-
Compress files3m 54s
-
Conclusion
-
Next steps40s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Create temporary swap files