2015.3.23 Linux under Disk Management

Source: Internet
Author: User

1. View the capacity of a disk or directory

DF View Disk partition usage

Df-i-h-m

Du view the amount of space a directory or file occupies

DU-A/tmp: Train full file and directory size

Du-c: Final Summary


2. Partitioning and formatting of disks

Fdisk-l viewing disks and partitions, greater than 2T with GPT

MKFS.EXT3, MKFS.EXT4, mke2fs-t EXT4 formatted partitions

Default Blocks (5.00%) reserved for the Super User # #给超级用户预留的空间, special purpose for formatting

-M can change this scale, such as Mke2fs-m 0.1/dev/sdb1 # #意思是只预留出0.1%


3. Mount and Unmount disk partitions

Mount does not have any options and parameters to see what is already mounted

mount/dev/sdb5/newdir/mount the/DEV/SDB5 to the/newdir directory, dmesg|tail view the error message if the mount fails Umount/newdir


4. configuration file/etc/fstab

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5C/9B/wKiom1UeJWOTcGC_AAI-OLiwIpk434.jpg "title=" 2.png " alt= "Wkiom1uejwotcgc_aai-oliwipk434.jpg"/>

The first column is the identity of the partition, the label or UUID or the partition name of the partition can be written, the second column is the mount point, the third column is the partition format, the fourth column is a number of mount parameters, usually directly write defaults, the number of the fifth column indicates whether the dump backup, 1 is 0 no The sixth column indicates whether a self-test disk is turned on, 1, 2 for self-test, 0 not self-checking, 1 for high priority,/partition must be 1.

The parameter of the fourth row mount: ' Auto/noauto ' automatically mount the boot or not

"Async/sync": Async disk and memory out of sync, the system writes memory data to disk at intervals, sync synchronizes in real time

"Default": sets the mount definition according to the default values of most file systems, including Rw,suid,dev,exec,auto,nouser,async

"Ro": Mount by read-only permission; "RW": Mount according to read and write permission;

"Exec/noexec": Allow/not allow executable file execution, but must not mount the root partition as noexec, so it can not be started, can only redo the system

"User/nouser": Allow/Do not allow other users to mount the partition outside the root, for security reasons, general use Nouser

"Suid/nosuid": Allow/Disallow partitioning with SUID properties, general settings Nosuid

"Usrquota": Start consumer disk quota mode

"Grquota": Start the group disk quota mode

After you modify/etc/fstab add label=test Add in, use Mount-a to mount.

Blkid viewing the UUID of each partition


Create a swap file to increase virtual memory

#dd if=/dev/zero of=/tmp/newdisk bs=4k count=102400 partition target file size: Bs*count

#mkswap-F/tmp/newdisk

#free-M

#swapon/tmp/newdisk

#free-M




This article is from the "Rhythm" blog, make sure to keep this source http://rhythm.blog.51cto.com/2800158/1628058

2015.3.23 Linux under Disk Management

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.