Linux. Создать рэйд

[root@dbserver38 samba]# fdisk -l | grep sd
Disk /dev/sda: 4000.8 GB, 4000787030016 bytes
/dev/sda1 1 267349 2147480811 83 Linux
/dev/sda2 267350 486401 1759535190 83 Linux
Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
/dev/sdc1 * 1 64 512000 83 Linux
/dev/sdc2 64 30402 243685376 8e Linux LVM
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdf: 1000.2 GB, 1000204886016 bytes

[root@dbserver38 samba]# mkfs.ext4 /dev/sdd
mke2fs 1.43-WIP (20-Jun-2013)
/dev/sdd is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61054976 inodes, 244190646 blocks
12209532 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@dbserver38 samba]# mkfs.ext4 /dev/sde
mke2fs 1.43-WIP (20-Jun-2013)
/dev/sde is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61054976 inodes, 244190646 blocks
12209532 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: ^[[Adone

[root@dbserver38 samba]# mkfs.ext4 /dev/sdf
mke2fs 1.43-WIP (20-Jun-2013)
/dev/sdf is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61054976 inodes, 244190646 blocks
12209532 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@dbserver38 samba]# mdadm —create —verbose /dev/md0 —level=0 —raid-devices=3 /dev/sdd /dev/sde /dev/sdf
mdadm: An option must be given to set the mode before a second device
(—verbose) is listed

[root@dbserver38 samba]# mdadm —-create —-verbose /dev/md1 —-level=raid0 -—raid-devices=3 /dev/sdd /dev/sde /dev/sdf
mdadm: An option must be given to set the mode before a second device
(—-verbose) is listed

[root@dbserver38 samba]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb76ab7cb.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal I/O) size boundary is recommended, or performance may be impacted.
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').

Command (m for help): n
Command action
e extended
p primary partition (1-4)p
Partition number (1-4): 1
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-121601, default 121601):
Using default value 121601

Command (m for help): n
Command action
e extended
p primary partition (1-4)p
Partition number (1-4): 2

No free sectors available

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

[root@dbserver38 samba]# fdisk -l | grep sd
Disk /dev/sda: 4000.8 GB, 4000787030016 bytes
/dev/sda1 1 267349 2147480811 83 Linux
/dev/sda2 267350 486401 1759535190 83 Linux
Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
/dev/sdc1 * 1 64 512000 83 Linux
/dev/sdc2 64 30402 243685376 8e Linux LVM
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
/dev/sdd1 1 121601 976760001 83 Linux
Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdf: 1000.2 GB, 1000204886016 bytes

[root@dbserver38 samba]# fdisk /dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x688af262.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
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').

Command (m for help): n
Command action
e extended
p primary partition (1-4)p
Partition number (1-4): 1
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-121601, default 121601):
Using default value 121601

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

[root@dbserver38 samba]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x112d1a4f.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
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').

Command (m for help): n
Command action
e extended
p primary partition (1-4)p
Partition number (1-4): 1
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-121601, default 121601):
Using default value 121601

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

[root@dbserver38 samba]# fdisk -l | grep sd
Disk /dev/sda: 4000.8 GB, 4000787030016 bytes
/dev/sda1 1 267349 2147480811 83 Linux
/dev/sda2 267350 486401 1759535190 83 Linux
Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
/dev/sdc1 * 1 64 512000 83 Linux
/dev/sdc2 64 30402 243685376 8e Linux LVM
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
/dev/sdd1 1 121601 976760001 83 Linux
Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
/dev/sde1 1 121601 976760001 83 Linux
Disk /dev/sdf: 1000.2 GB, 1000204886016 bytes
/dev/sdf1 1 121601 976760001 83 Linux

[root@dbserver38 samba]# mdadm —-create —-verbose /dev/md1 —-level=raid0 -—raid-devices=3 /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm: An option must be given to set the mode before a second device
(—-verbose) is listed

[root@dbserver38 samba]# mdadm -create -verbose /dev/md1 -level=raid0 -raid-devices=3 /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm: -c does not set the mode, and so cannot be the first option.

[root@dbserver38 samba]# mdadm -create -verbose /dev/md1 -level=0 -raid-devices=3 /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm: -c does not set the mode, and so cannot be the first option.

[root@dbserver38 samba]# mdadm --create --verbose /dev/md0 -level=0 -raid-devices=3 /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm: invalid raid level: evel=0

[root@dbserver38 samba]# mdadm --create --verbose /dev/md0 -l 0 -n 3 /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm: chunk size defaults to 512K
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

[root@dbserver38 samba]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Mon Oct 11 15:37:20 2021
Raid Level : raid0
Array Size : 2929886208 (2794.16 GiB 3000.20 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Mon Oct 11 15:37:20 2021
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Chunk Size : 512K
Name : dbserver38:0 (local to host dbserver38)
UUID : dbe61921:923b8cd6:8cf22f73:b666a261
Events : 0
Number Major Minor RaidDevice State
0 8 49 0 active sync /dev/sdd1
1 8 65 1 active sync /dev/sde1
2 8 81 2 active sync /dev/sdf1

[root@dbserver38 samba]# mkfs.ext4 /dev/md0
mke2fs 1.43-WIP (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=384 blocks
183123968 inodes, 732471552 blocks
36623577 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22354 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848, 512000000, 550731776, 644972544
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@dbserver38 samba]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdf1[2] sde1[1] sdd1[0]
2929886208 blocks super 1.2 512k chunks
unused devices: <none>

[root@dbserver38 samba]# mdadm --detail --scan --verbose | awk '/ARRAY/ {print}' >> /etc/mdadm.conf

[root@dbserver38 samba]# cat /etc/mdadm.conf
ARRAY /dev/md0 level=raid0 num-devices=3 metadata=1.2 name=dbserver38:0 UUID=dbe61921:923b8cd6:8cf22f73:b666a261

[root@dbserver38 samba]# mkdir /mnt/raid0_3tb

[root@dbserver38 samba]# ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 9 Oct 11 13:03 02e5e132-f3e0-4c9f-af57-f943265e0a3a -> ../../sdb
lrwxrwxrwx 1 root root 10 Oct 11 12:59 1127b084-f348-4cd8-8f33-daff5997927a -> ../../dm-0
lrwxrwxrwx 1 root root 9 Oct 11 15:37 26783b40-5dbb-4325-b726-7678f34def87 -> ../../sde
lrwxrwxrwx 1 root root 10 Oct 11 13:03 31ae05f9-0fc0-46ce-bf04-df9688c3f8f6 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 11 12:59 4849bd8c-ec78-4709-9f1e-feaeb82e473d -> ../../dm-1
lrwxrwxrwx 1 root root 9 Oct 11 15:38 73e0b361-3ed7-4336-82b9-cd9360180757 -> ../../md0
lrwxrwxrwx 1 root root 9 Oct 11 15:37 92cf46fa-3e85-40db-901f-1aa4ea948a98 -> ../../sdf
lrwxrwxrwx 1 root root 10 Oct 11 12:59 a7bed9d3-9957-4dbe-85d6-9a4e70b870f1 -> ../../dm-2
lrwxrwxrwx 1 root root 9 Oct 11 15:37 b4fe3438-a3af-4928-b896-dc3108118f4a -> ../../sdd
lrwxrwxrwx 1 root root 10 Oct 11 12:59 e9e444cc-123f-442e-a338-a97b113e289f -> ../../sdc1
lrwxrwxrwx 1 root root 9 Oct 11 12:59 efd0f89e-539c-4999-85fa-424f0faa367e -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 11 13:03 f2b52d79-a288-41c8-9d7d-834c5e44361f -> ../../sda1

Комментарии

Популярные сообщения из этого блога

TRUNCATE / DELETE / DROP или как очистить таблицу

Linux (РедОС). Сброс пароля

ЭС с ЦБ РФ. РЕКВИЗИТНЫЙ СОСТАВ ЭС

КБК. КВФО - Код вида финансового обеспечения (деятельности)

ТФФ 35.0. Полный перечень документов альбома ТФФ (Таблица 2)