Linux Hard disk operation documentary

Source: Internet
Author: User

This paper mainly records my operations in the operation of the work of a hard disk.


Environment:

This server is a Hadoop slavenode, which has 12 disks, each disk made only one partition, not do LVM.


Fault Detection:

After boarding the server, we find that a disk is missing:

#df-H

Filesystem Size used Avail use% mounted on

/dev/sda2 451G 20G 408G 5%/

Tmpfs 36G 0 36G 0%/dev/shm

/DEV/SDB1 1.9T 1.5T 354G 81%/HADOOP/1

/DEV/SDC1 1.9T 1.5T 357G 81%/HADOOP/2

/DEV/SDD1 1.9T 1.5T 351G 81%/HADOOP/3

/dev/sde1 1.9T 1.4T 402G 79%/HADOOP/4

/DEV/SDF1 1.9T 1.5T 371G 80%/HADOOP/5

/DEV/SDG1 1.9T 1.5T 375G 80%/HADOOP/6

/DEV/SDH1 1.9T 1.5T 388G 79%/HADOOP/7

/dev/sdi1 1.9T 1.5T 383G 80%/HADOOP/8

/dev/sdj1 1.9T 1.5T 394G 79%/HADOOP/9

/DEV/SDL1 1.9T 1.5T 377G 80%/HADOOP/11

/DEV/SDM1 1.9T 1.5T 386G 79%/HADOOP/12


Careful observation will find/HADOOP/10 no, the corresponding should be/dev/sdk1, that hard drive where to go?


Fault Analysis:

View with Fdisk:

#fdisk-L/DEV/SDK

Found this disk is GPT table, here interspersed with the small knowledge of the partition table, partition table most commonly used is mbr,gpt is a relatively new one, less useful.

Because other hard disks are MBR partitioned tables, this hard drive should also be MBR, which is estimated to be caused by a mistake by someone.


Fault resolution:

-delete the original partition table information with FDISK and create a new partition:

#fdisk/DEV/SDK

-Use the parted tool to convert the Partition1 partition table to MBR:

#parted/dev/sdk1#mklabel Msdos#quit

-delete reserved 5% of the disk space:

#tune2fs-M 0/DEV/SDK1

-Format the partition with EXT4:

#mkfs. Ext4/dev/sdk1

-View disk information:

#fdisk-L/DEV/SDK


disk/dev/sdk:2000.4 GB, 2000398934016 bytes

255 heads, Sectors/track, 243201 cylinders

Units = Cylinders of 16065 * 8225280 bytes

Sector size (logical/physical): bytes/512 bytes

I/O size (minimum/optimal): bytes/512 bytes

Disk Identifier:0xea6649b8


Device Boot Start End Blocks Id System

/DEV/SDK1 1 243201 1953512001 Linux


-All normal, view/etc/fstab:

.......

LABEL=/HADOOP09/HADOOP/9 ext4 Defaults,noatime,nodiratime,noauto 0 2

LABEL=/HADOOP10/HADOOP/10 ext4 Defaults,noatime,nodiratime,noauto 0 2

........

Implementation

#mount-A

-again with Fdisk to see, how still no mount. Decide to manually mount one time:

#mount Label=/hadoop10/hadoop/10-o defaults,noatime,nodiratime,noauto-t Ext4

-Again with Fdisk view, incredibly good:

#df-H

......

/dev/sdk1 1.8T 1.9G 1.8T 1%/HADOOP/10


Feelings:

Sometimes really can't believe mount-a, have time to look at its source code, see how it works.

This article from the "Linux and Network" blog, reproduced please contact the author!

Linux hard disk operation record

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.