Linux parted partition and Mount __linux

Source: Internet
Author: User
Tags uuid

System for CentOS 6.5, others installed the system, the hard disk is 4TB, but Df-h found only a 1TB, so they set out to partition.

Online Search a lot of information, some only talk about parted, and did not talk about the use of parted partition after how to mount. This article does not detail each command, sharing only the steps that are available under your own partitions and mounts. View existing Partitions Parted-l

[Root@localhost ~]# parted-l 

model:dell PERC H730 Mini (SCSI)
DISK/DEV/SDA:4197GB
sector size (logical/phy sical): 512b/512b
Partition table:gpt

number  Start   end     Size    File system     Name   Flags
 1      1049kB  1049GB  1049GB  ext4                   boot
 2      1049GB  1101GB  52.4GB  Linux-swap (v1)

Disk /dev/sda: 4197GB means that my hard drive has 4TB, (in order to get all the space out, this maximum value will be used after)

Number Start end Size File system Name Flags
1 1049kB 1049GB 1049GB ext4 Boot
2 1049GB 1101GB 52.4GB linux-swap (v1)
Indicates that my hard drive is only zoned for about 1TB

Now we have to partition the remaining 3TB and mount it. Parted into parted mode

[Root@localhost ~]# parted
GNU parted 2.1 using/dev/sda Welcome to
GNU parted! Type ' help ' to view a list of commands.
(parted)      
Enter Mkpart in parted mode, create new partition
[Root@localhost ~]# parted
GNU parted 2.1 using/dev/sda Welcome to
GNU parted! Type ' help ' to view a list of commands.
(parted) Mkpart                                                           
Partition name?  []?  

Above the. Enter the name of the new partition you want to enter, such as Gpt2

[Root@localhost ~]# parted
GNU parted 2.1 using/dev/sda Welcome to
GNU parted! Type ' help ' to view a list of commands.
(parted) Mkpart                                                           
Partition name?  []? GPT2                                                 
File system type?  [Ext2]?   

Then enter the format of the file, said parted on the internet can be: EXT2, FAT16, FAT32, LINUXSWAP, NTFS, ReiserFS, UFS and so on.
It seems that there is no ext4, but there is no relationship, the following will be formatted. You can enter ext2 first.
And then you'll have to choose where to start the partition,
It depends on where you started the partition,
Number Start end Size File system Name Flags
1 1049kB 1049GB 1049GB ext4 Boot
2 1049GB 1101GB 52.4GB linux-swap (v1)
My top End is 1101GB, so my current partition starts at 1101GB, and end is set to the maximum size of my hard drive, 4197GB

[Root@localhost ~]# parted
GNU parted 2.1 using/dev/sda Welcome to
GNU parted! Type ' help ' to view a list of commands.
(parted) Mkpart                                                           
Partition name?  []? GPT2                                                 
File system type?  [Ext2]? ext2                                           
Start 1101GB End                                                             
4197GB    

Then there is the hint, select Yes, so that the partition succeeds, this time parted-l is visible.

But df-h because it is not mounted.
I format it first because I want to use the EXT4 partition format.
because my hard drive is always/DEV/SDA, Blkid can see/DEV/SDA1,/dev/sda2, so my new partition is/dev/sda3.
Formatting commands: mkfs-t Ext4/dev/sda3

[Root@localhost ~]# blkid/dev/sda1:uuid= "44bc2578-2309-43d9-917a-8980d480662a" type= "Ext4"/dev/sda2:uuid= " 6c9c0b5f-f094-4dff-94f8-9857b917d299 "type=" swap [root@localhost ~]# mkfs-t ext4/dev/sda3 mke2fs 1.41.12 (17-May-201 0) FileSystem label= OS Type:linux block size=4096 (log=2) Fragment size=4096 (log=2) stride=0 blocks, stripe width=0 blo Cks 188956672 inodes, 755822080 blocks 37791104 blocks (5.00%) reserved for the super user-i-block=0 file System blocks=4294967296 23066 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group superb Lock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4 096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848, 512000000, 550731776, 64 4972544 writing inode tables:done creating Journal (32768 Blocks): Done writing Superblocks and filesystem Accounting InformatiOn:done this filesystem'll be automatically checked every/mounts days, 180 whichever a.

Use Tune2fs-c or-i to override.            [Root@localhost ~]# df-h filesystem Size Used avail use% mounted on/dev/sda1 962G 4.0G 909G 1%/TMPFS 32G 0 32G 0%/dev/shm

When the format is complete, mount mounts to the/home directory, and of course you can select a different directory.

[Root@localhost ~]# mount-t ext4/dev/sda3/home

[root@localhost ~]# df-h
filesystem      Size  Used Avail Us E% mounted on
/dev/sda1       962G  4.0G  909G   1%/
tmpfs            32G     0   32G   0%/dev/ SHM
/dev/sda3       2.8T  201M  2.7T   1%/home

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.