Linux mount partition + swap partition

Source: Internet
Author: User
Tags hex code

The default mount directory for partitions is the/MNT directory

Mount must be mounted to an already existing mount point Mkdir-p/MNT/IMOOC

Mount/dev/sdb1/mnt/imooc the DEV/SDB1 to MNT/IMOOC.

Umount/dev/sdb1/mnt/imooc This is the solution mount

vim +/etc/fstab: Write the location of the file where the drive is mounted

Automatic mount of partitions can be implemented

Join/DEV/SDB1/MNT/IMOOC Defaults 0 0

How to add a swap swap partition to a hard disk

First, build a common Linux partition

Say a primary partition or logical partition into a swap partition

T 82

Format swap partition: MKSWAP/DEV/SDB6

[Email protected] ~]# Fdisk/dev/sdb

Warning:dos-compatible mode is deprecated. It ' s strongly recommended to
Switch off the mode (command ' C ') and change display units to
Sectors (Command ' u ').

Command (M for help): P

disk/dev/sdb:4294 MB, 4294967296 bytes
255 heads, Sectors/track, 522 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x0d716927

Device Boot Start End Blocks Id System
/DEV/SDB1 1 1060258+ Linux
/DEV/SDB2 133 1060290 Linux
/DEV/SDB3 265 522 2072385 5 Extended
/DEV/SDB5 265 329 522081-Up Linux
/DEV/SDB6 522 1550241 Linux

Command (M for help): t
Partition number (1-6): 6
Hex code (Type L to list codes): L

0 Empty NEC DOS bayi minix/old Lin BF Solaris
1 FAT12 Plan 9 swap/so C1 drdos/sec (fat-
2 Xenix root 3c partitionmagic Linux C4 drdos/sec (fat-
3 Xenix usr Venix 80286 os/2 hidden c:c6 drdos/sec (fat-
4 FAT16 <32m PPC PReP Boot-up Linux extended C7 Syrinx
5 Extended SFS, NTFS volume set da non-fs data
6 FAT16 4d qnx4.x NTFS Volume set db cp/m/CTOS/.
7 Hpfs/ntfs 4e qnx4.x 2nd part of the Linux plaintext de Dell Utility
8 AIX 4f qnx4.x 3rd part 8e Linux LVM DF bootit
9 AIX bootable Ontrack DM Amoeba E1 DOS Access
A os/2 Boot manag Wuyi ontrack DM6 Aux 94 Amoeba BBT E3 DOS r/o
b W95 FAT32 cp/m 9f bsd/os e4 speedstor
C W95 FAT32 (LBA) Ontrack DM6 Aux A0 IBM Thinkpad hi EB BeOS FS
E W95 FAT16 (LBA) OnTrackDM6 a5 FreeBSD ee GPT
F W95 Ext ' d (LBA) ez-drive a6 OpenBSD ef EFI (fat-12/16/
Ten OPUS Bow A7 NeXTSTEP f0 linux/pa-risc b
One Hidden FAT12 5c Priam edisk A8 Darwin UFS F1 SpeedStor
Compaq diagnost speedstor A9 NetBSD f4 SpeedStor
Hidden FAT16 <3, GNU HURD or Sys ab Darwin boot F2 DOS Secondary
Hidden FAT16 Novell Netware af hfs/hfs+ fb VMware VMFS
Hidden hpfs/ntf Novell Netware b7 BSDI FS FC VMware Vmkcore
AST smartsleep disksecure Mult b8 BSDI swap fd Linux RAID auto
1b Hidden W95 FAT3 pc/ix bb Boot Wizard hid Fe lanstep
1c Hidden W95 FAT3, Minix be Solaris boot ff BBT
1e Hidden W95 FAT1
Hex code (type L to list codes): 82
Changed system type of partition 6 to Swap/solaris (Linux)

Command (M for help): P

disk/dev/sdb:4294 MB, 4294967296 bytes
255 heads, Sectors/track, 522 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x0d716927

Device Boot Start End Blocks Id System
/DEV/SDB1 1 1060258+ Linux
/DEV/SDB2 133 1060290 Linux
/DEV/SDB3 265 522 2072385 5 Extended
/DEV/SDB5 265 329 522081-Up Linux
/DEV/SDB6 522 1550241 Swap/solaris

Command (M for help): W
The partition table has been altered!

Calling IOCTL () to re-read partition table.
Syncing disks.
[Email protected] ~]# MKSWAP/DEV/SDB6
Setting up Swapspace version 1, size = 1550236 KiB
No label, UUID=D82909CA-522B-4557-B89A-C0F6C33CCC3B
[Email protected] ~]# SWAPON/DEV/SDB6
[[email protected] ~]# free
Total used free shared buffers Cached
mem:1030304 144076 886228 304 12704 59856
-/+ buffers/cache:71516 958788
swap:3598232 0 3598232
[Email protected] ~]#

SWAPOFF/DEV/SDB6: Stop the Swap partition:

Linux mount partition + swap partition

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.