Mount a new hard drive in the Ubuntu environment

Source: Internet
Author: User

one, hard disk partition | Hard disk Add new partition

1, display the hard disk and its own partition situation. Enter the following command in the terminal window:

sudo fdisk-l

Displays the current hard disk and the owning partition. As shown in the following:
System tip: Disk/dev/sdb doesn ' t contain a valid partition table.

2 , partition the hard disk. Enter the following command in the terminal window:

sudo fdisk/dev/sdb

As shown in the following:
Enter M after the command (m for help) prompt to display a helper menu.

After entering N at the command (m for help) prompt, execute the Add a new partition instruction to add another partition to the hard disk.
When the command action appears, enter E, specifying that the partition is an extended partition (extended).
When partition number (1-4) appears, input 1 indicates that only one area is divided.
The subsequent specified starting cylinder face (cylinder) number completes the partition.

enter p at the command (m for help) prompt to display the partition table.
The system prompts as follows:
Device Boot Start End Blocks Id System
/dev/sdb1 1 26108 209712478+ 5 Extended

Enter W after the command (m for help) prompt to save the partition table.
System hint: the partition table has been altered!

style= margin:0px "; padding:0px; Box-sizing:border-box; line-height:24.5px; " > into following command:

sudo fdisk-l

as shown in the following:
The system has identified the partition of the hard disk/dev/sdb.


two, HDD format | Format hard disk

1, display the hard disk and its partition. Enter the following command in the terminal window

sudo mkfs-t ext4/dev/sdb

Description
-T EXT4 indicates that the partition is formatted as a EXT4 file system type.



three, mount HDD partition | Mount hard disk partition

1, display the hard drive mount condition. Enter the following command in the terminal window :

Df-l

the new hard disk partition is not mounted and cannot be accessed and viewed.

enter the following command in the terminal window:

sudo mount-t ext4/dev/sdb/devdata

enter the following command again in the terminal window :

Df-l

The new hard disk partition is already mounted, such as the bottom red box content.

2. Configure the hard drive to automatically mount on the system boot. Add the following configuration to the file/etc/fstab :

/dev/sdb/devdata EXT4 Defaults 0 0

The mount of the Ubuntu hard drive is now complete


Mount a new hard drive in the Ubuntu environment

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.