Linux add hard drives and mounts

Source: Internet
Author: User

1. Use Fdisk-l to view hard drive details

Analysis:

2. Partition initialization

Fdisk/dev/sdb

Analysis: Parsing of individual parameters

1. Enter m to display all the commands listed below.

        2. Enter p to display the hard disk segmentation and print the partition table.

3. Enter a to set the boot area of the hard drive.

        4. Enter N to set a new hard disk partition .

4.1. Enter the E-drive as the [extended] partition (extend).

4.2. Enter the P drive as [primary] partition (primary).

5. Enter T to change the drive partition properties.

T: Partition system ID number L:82:linux swap83:linux86:ntfs window partition

6. Enter d to delete the hard drive partition properties.

      7. Enter Q End does not deposit the hard disk partition attribute.

        8. Enter W to end and write to disk partition properties

Device Boot StartEndBlocks IdSystem/DEV/SDA1 * 1 26 204800 83linuxpartition1 does notEndOn cylinder BOUNDARY./DEV/SDA2-287 2097152-per-Linux swap/solarispartition2 does notEndOn cylinder BOUNDARY./DEV/SDA3 287 2611 18668544 83Linuxdisk/dev/sdb:10.7 GB, 10737418240bytes255 heads, Sectors/track, 1305cylindersunits= Cylinders of 16065 * 512 = 8225280bytessector size (logical/physical): bytes/512Bytesi/o Size (minimum/optimal): bytes/512Bytesdisk identifier: 0X02537CBFDevice Boot StartEndBlocks IdSystem/dev/sdb1 1 1305 10482381 Linux partition created successfully

Note: 1.

Partition number (1-4): 2 #如果这里已经创建了1个分区, then this value cannot be entered 1.

3. Partitioned file Systems

Assigning file systems to partitions: Ext2 and Ext3

MKE2FS/DEV/SDB1 #默认是ext2, this command is to create a file system

mke2fs -j/dev/sdb1 #-j is ext3

Mke2fs-t EXT4/DEV/SDB1 #ext4创建文件系统

e2fsck -P/DEV/SDB1 #检查文件系统: File, Sector has error parameter-P is automatic repair
This filesystem would be automatically checked every mounts orthe days of the whichever comes first.   use tune2fs-c or-i to override.
Parse: Mount 37 or 180 days after file system detection
TUNE2FS-L/DEV/SDB1 #查看文件系统的详细信息-L View Details-C 30/DEV/SDB1 set how many times to check (Mount how many times to detect)-I 70d/dev/sdb1 70-day check (how many days detection)

E2LABEL/DEV/SDB1 Www-data #指定转标

Findfs Www-data #查找转标

4. Mounting

Vim/etc/fstab The permanent mount configuration is added as follows in the file:/dev/sdb1/opt ext3 defaults 1 1mount: View partition Format-A mount information immediately effective-t ext3 /dev/sdb1/opt temporary mount Linux partition-T VFAT/DEV/SDC1//media/usb U-Disk Mount window partition-O-loop docs.iso/media/iso mount image file Mount M Edia/cdrom Optical drive Mount umount/opt unload mount

5 Successes

Df-h: View current Drive usage

Linux add hard drives and mounts

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.