New raid1~ in Linux come and take a look at it.

Source: Internet
Author: User
Tags hex code

OperationPartitioning:

[Email protected] ~]# fdisk-l

disk/dev/sdb:21.5 GB, 21474836480 bytes

255 heads, Sectors/track, 2610 cylinders

Units = Cylinders of 16065 * 8225280 bytes

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

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

Disk identifier:0x00000000

disk/dev/sdc:21.5 GB, 21474836480 bytes

255 heads, Sectors/track, 2610 cylinders

Units = Cylinders of 16065 * 8225280 bytes

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

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

Disk identifier:0x00000000

disk/dev/sdd:21.5 GB, 21474836480 bytes

255 heads, Sectors/track, 2610 cylinders

Units = Cylinders of 16065 * 8225280 bytes

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

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

Disk identifier:0x00000000

Fdisk/dev/sdb

Warning:dos-compatible mode is deprecated. It ' s strongly recommended to

Switch off the mode (command ' C ') and change display units to

Sectors (Command ' u ').

[Email protected] ~]# Fdisk/dev/sdb

Command (M for help): t

Selected partition 1

Hex code (type L to list codes): FD

Changed system type of partition 1 to FD (Linux raid AutoDetect)

EstablishRAID1

[Email protected] ~]# mdadm-c/dev/md0-l 1-n 2/dev/sd[bc]1

Mdadm:Note:this array have metadata at the start and

May is suitable as a boot device. If you plan to

Store '/boot ' on this device, ensure that

Your Boot-loader understands md/v1.x metadata, or use

--metadata=0.90

Continue creating array? Yes

Mdadm:defaulting to version 1.2 metadata

Mdadm:array/dev/md0 started.

Creating a file system

Formatting :

[Email protected] ~]# mkfs.ext4/dev/md0

[Email protected] ~]# mkdir/data/

[Email protected] ~]# mount/dev/md0/data/

[Email protected] ~]# ll/data/

Total 16

drwx------2 root root 16384 5 11:16 lost+found

[email protected] ~]# Vi/etc/fstab

At the end, add the following:

drwx------2 root root 16384 15:21 lost+found

[Email protected] ~]# Mdadm-ds

Array/dev/md0 metadata=1.2 name=localhost.localdomain:0 uuid=c00e8204:a51e89ea:f6069fbe:9350ed9a

Write a configuration file

[Email protected] ~]# Mdadm-ds >>/etc/mdadm.conf

Restart

[email protected] ~]# reboot

[email protected] ~]# mount

/dev/mapper/volgroup-lv_root on/type ext4 (rw)

Proc On/proc type proc (rw)

Sysfs On/sys type SYSFS (rw)

Devpts on/dev/pts type devpts (rw,gid=5,mode=620)

Tmpfs ON/DEV/SHM type TMPFS (rw)

/DEV/SDA1 on/boot type EXT4 (rw)

/dev/md0 on/data type EXT4 (rw)

None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)

Analog Failure

[Email protected] ~]# mdadm/dev/md0-a/DEV/SDB1

Mdadm:added/dev/sdb1

[Email protected] ~]# Cat/proc/mdstat

Personalities: [RAID1]

Md0:active RAID1 sdb1[2] sdc1[1]

20948288 blocks Super 1.2 [2/1] [_u]

[=====>.......] Recovery = 28.7% (6021952/20948288) finish=1.5min speed=159484k/sec

Unused devices: <none>

This article is from "fresh dinosaur meat Quick Come" blog, please be sure to keep this source http://9283898.blog.51cto.com/9273898/1540174

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.