Linux disk partition Fdisk partition and parted partition

Source: Internet
Author: User

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ disk partition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ 1. Creating a partition [[email protected] ~]# fdisk-l Viewing the partition of a disk [[email protected] ~]# Fdisk/dev /sdbcommand (M for help): M get assistance viewing specific can use those commands Actiona toggle a bootable FLAGB edit BSD DISKLABELC toggle the DOS Co Mpatibility FLAGD Delete a partitionl list known partition TYPESM print this Menun add a new Partitiono create a new empty DOS partition Tablep Print the partition Tableq quit without saving changess create a new empty Sun disklabelt change a P Artition ' s system idu change display/entry UNITSV Verify the partition Tablew write table to disk and EXITX extra function Ality (experts only) command (M-help): N New Partition Command Actione extended #扩展分区p Primary partition (1-4) P #主分区Partition num ber (1-4): 1 primary partition number first cylinder (1-10443, default 1):  using default value 1Last cylinder, +cylinders or +size{k,m,g } (1-10443, default 10443): +10g #指定分区的大Small  2. formatting [[email protected] ~]# mkfs.ext4/dev/sdb1 formatting SDB1 this partition 3. New mount directory  mkdir/music new mount directory 4. Mount using Mount/ Dev/sdb1/music mount Use the new partition =====cd/music=== copy some files past, test ==== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~parted Disk Partitioning  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ usage: parted [options] ... [Device [command [parameters] ...] ...]   Command: Check MINOR                   to perform a simple check on the file system CP [From-device] From-minor To-minor       Copy file system to another partition help [COMMAND]                 Print general assistance information or information about COMMAND Mklabel tag type               Create new disk label (partition table) mkfs MINOR file system type       MINOR Create a file system of type "file system type" Mkpart partition type [file system type] Start point end point       Create a partition MKPARTFS partition type file system type start point end point Create a Partition with file system move MINOR start point       move partition with number MINOR name MINOR             &NBS P Name the partition numbered MINOR named "print"[MINOR]                 print partition table, or section quit             & nbsp             Exit program Rescue start point           save missing partition near "start point", "End point" resize MINOR start point     Change the size of the file system in the partition numbered MINOR RM MINOR                 &NBSP ;     Delete partition with number MINOR Select device                     Select device set to edit MI Nor flag status           Change the flag for the partition numbered MINOR    the partition of the large disk in Linux can no longer use FDISK, MBR partition table only supports 2T disk, so more than 2T Disk must use a GPT partition table. The following steps are described below:  1. Divided into two primary partitions (Create Disk label mklable, then partition Mkpart partition type) [[email protected] ~]# Parted/dev/sdb # Use Parted to operate on GPT disks, enter interactive mode GNU Parted 1.8.1 using/dev/sdb Welcome to GNU parted! Type ' help ' to view a list of commands. (parted) Mklabel GPT           # format MBR disk as GPT (parted) print           & nbsp     &NBSp     #打印当前分区 (parted) Mkpart primary 0 4.5TB                # a 4.5T primary partition ( parted) Mkpart primary 4.5TB 12TB      # one 7.5T primary partition (parted) print           &NBSP ;             #打印当前分区 (parted) quit Quit Information:don ' t forget to update/etc/fstab, if necess Ary. 1 2. Then format to EXT4, you need to install package e4fsprogs.x86_64 (yum install e4fsprogs.x86_64). [[email protected] ~]# mkfs.ext4/dev/sdb1[[email protected] ~]# mkfs.ext4/dev/sdb2 3. Then mount the partition with Mount [[ email protected]]# mount-t ext4/dev/sdb1/bk[[email protected]]# mount-t ext4/dev/sdb2/mail[[email  Protected] ~]# df-thfilesystem    type    size  used Avail use% mounted On/dev/sda6   &NBSP ; ext3     39G  9.4g   28G  26%//dev/sda1     ext3    122m   13M  10 3M  12%/bootnone         TMPFS   1004M     0 1004M   0%/dev/shm/dev/sdb1     EXT4    4.1t   194M  3.9t &nbsp ; 1%/bk/dev/sdb2     EXT4    6.8t   179M  6.4t  1%/mail 4. Finally, modify the/etc/fstab, add the following two lines, Let it mount automatically./DEV/SDB1      /BK          EXT4           &NBS P;defaults,noatime       1 2/dev/sdb2      /mail       EXT4     &NB Sp     Defaults,noatime         1 2

Linux disk partition Fdisk partition and parted 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.