Linux Basic article -24,swap Exchange partition temporary emergency and division method

Source: Internet
Author: User

################################################

Swap

View physical memory and swap partition sizes and their usage

[Email protected] ~]# free-m

Total used free shared buffers Cached

mem:1869 192 1676 0 13 65

-/+ buffers/cache:114 1755

swap:255 0 255


################################################

Create swap partition

[Email protected] ~]# FDISK/DEV/SDA

N

+2g

T

8

82

W


/dev/sda8 9198 9459 2104483+, Linux Swap/solaris


################################################

formatting partitions

[Email protected] ~]# mkswap/dev/sda8


################################################

Mount Swap Partition

[Email protected] ~]# swapon/dev/sda8


################################################

Uninstalling swap partitions

[Email protected] ~]# swapoff/dev/sda8


################################################

Loopback device Loopback

Using software to emulate hardware


Swap partitions with files (temporary emergency)

[[email protected] ~]# dd If=/dev/zero of=/var/swapfile bs=1m count=1024

[Email protected] ~]# Mkswap/var/swapfile

[Email protected] ~]# Swapon/var/swapfile


################################################

Create an image file

DD If=/mn/cdrom Of=/usb/cdrom.backup.iso


Backup MBR

DD IF=/DEV/SDA of=mnt/usb/mbr.backup bs=512 count=1

DD If=mnt/usb/mbr.backup OF=/DEV/SDA

DD command: Powerful copy command

if= Data sources

of= Data storage target

Bs=1

conut=2

seek=#: Skipped file space size


This article is from the "James Zhan Linux Advanced ops" blog, so be sure to keep this source http://jameszhan.blog.51cto.com/10980469/1878633

Linux Basic article -24,swap Exchange partition temporary emergency and division method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.