(GO) Linux disk partition Fdisk partition and parted partition

Source: Internet
Author: User

Original: http://www.cnblogs.com/jiu0821/p/5503660.html

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Disk partition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. creating partitions [[email protected] ~]# Fdisk-l view disk partitioning [[email protected] ~]# Fdisk/dev/sdbcommand (M for help): M get assistance, view specific commands that can be used to command Actiona TOGGL e a bootable FLAGB edit BSD DISKLABELC toggle the DOS compatibility 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 Savi Ng changess Create a new empty Sun disklabelt change a partition ' s system idu change display/entry UNITSV Verify the Parti tion Tablew Write table to disk and EXITX extra functionality (experts-only) command (M-help): N new Partition command Actione EX Tended #扩展分区p primary partition (1-4) p #主分区Partition Number (1-4): 1 primary partition first cylinder (1-10443, default 1):  using Default value 1Last cylinder, +cylinders or +size{k,m,g} (1-10443, default 10443): +10g #指定分区的大小  2. formatting [[Email p Rotected] ~]# mkfs.ext4/dev/sdb1 format sDB1 this partition 3. New mount directory  mkdir/music new mount directory 4. Mount with Mount/dev/sdb1/music mount using the new partition =====cd/music=== copy some files past, test ==== ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~parted disk partition  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 "names" Print [MINOR]                Print partition table, or partition quit                           to exit program Rescue start point termination Point           save missing partitions near "start point", "End point" resize MINOR start point     Change file system size in partition numbered MINOR RM MIN OR                       Delete MINOR partition Select device     &NBS P               Select device set MINOR Flag status           change number of MINOR Zone flag    partition of large disk under Linux no longer use FDISK, MBR partition table only supports 2T disk, so disks larger than 2T must use 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           #打印当前分区 (parted) Mkpart primary 0 4.5TB               # 4.5T primary partition (parted) Mkpart primary 4.5TB 12TB      # 7 .5T primary partition (parted) print                         #打印当前分区 (parted) Quit Quit Information:don ' t forget to update/etc/fstab, if necessary. 1 

2. Then format into EXT4, 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 &N Bsp   EXT4    4.1t   194M  3.9t  1%/bk/dev/sdb2     EXT4    6.8t   179 M  6.4t  1%/mail 4. Finally, modify the/etc/fstab, add the following two lines, so that they boot automatically mount./dev/sdb1      /BK          EXT4            defaults,noatime       1 2/dev/sdb2      /mail       EXT4           Defaults , Noatime         1 2

(GO) Linux disk partition Fdisk partition and parted partition

Related Article

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.