Linux Add new hard disk and partition, format, mount

Source: Internet
Author: User

1. View the partition information:

[Email protected]/]# fdisk-l

disk/dev/vdb:209.7 GB, 209715200000 bytes
Heads, Sectors/track, 406349 cylinders
Units = Cylinders of 1008 * 516096 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

2, hard disk partition:

[Email protected]/]# FDISK/DEV/VDB
Command (M for help): M

Command Action
   a   toggle a bootable flag
   b   Edit BSD disklabel< br>   c   Toggle the DOS compatibility flag
   d   Delete a partition
& nbsp;  l   list known partition types
   m   Print this menu
   n& nbsp;  add a new partition
   o   Create a new empty DOS partition table
   P&nbs p;  Print the partition table
   q   quit without saving changes
   s & nbsp Create a new empty Sun Disklabel
   t   Change a partition ' s system ID
   u   ; Change display/entry units
   v   Verify the partition table
   w   Write Table to disk and exit
   x   Extra functionality (experts only)   

Command (M for help): N

Command Action
E Extended
P primary partition (1-4)

P
Partition number (1-4): 1

First cylinder (1-406349, default 1):
Using Default value 1
Last cylinder, +cylinders or +size{k,m,g} (1-406349, default 406349):
Using Default Value 406349

3. Format the hard drive:

[Email protected]/]# mkfs-t EXT4/DEV/VDB1

4. Mount the hard disk partition:

[Email protected]/]# Mount/dev/vdb1/home

4.1. Unmount the hard disk partition:

[Email protected]/]# Umount/home

5. Add the Mount command to the system startup entry:

[[email protected]]# vim/etc/fstab/dev/vdb1/home                   ext4    defaults        1 3

[The END]

Linux Add new hard disk and partition, format, mount

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.