Skip to content

Commit fbbee33

Browse files
committed
First version of RAID.
1 parent 8220954 commit fbbee33

7 files changed

Lines changed: 488 additions & 21 deletions

File tree

doc/image/binary-explosion.png

-9.39 KB
Loading
4.63 KB
Loading

doc/image/raid-0-1-5.png

24.3 KB
Loading
96.8 KB
Loading

doc/image/tmux-illustration.png

-81 KB
Loading

doc/linux-2.tex

Lines changed: 380 additions & 21 deletions
Large diffs are not rendered by default.

mdadm.txt

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
2+
chrichri@ubuntu:~$ sudo apt install mdadm
3+
...
4+
chrichri@ubuntu:~$ sudo systemctl status mdmonitor
5+
● mdmonitor.service - MD array monitor
6+
Loaded: loaded (/lib/systemd/system/mdmonitor.service; static; vendor preset: enabled)
7+
Active: inactive (dead)
8+
chrichri@ubuntu:~$ sudo systemctl enable mdmonitor
9+
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
10+
settings in the [Install] section, and DefaultInstance for template units).
11+
This means they are not meant to be enabled using systemctl.
12+
Possible reasons for having this kind of units are:
13+
1) A unit may be statically enabled by being symlinked from another unit's
14+
.wants/ or .requires/ directory.
15+
2) A unit's purpose may be to act as a helper for some other unit which has
16+
a requirement dependency on it.
17+
3) A unit may be started when needed via activation (socket, path, timer,
18+
D-Bus, udev, scripted systemctl call, ...).
19+
4) In case of template units, the unit is meant to be enabled with some
20+
instance name specified.
21+
chrichri@ubuntu:~$ sudo systemctl start mdmonitor
22+
chrichri@ubuntu:~$ sudo systemctl status mdmonitor
23+
● mdmonitor.service - MD array monitor
24+
Loaded: loaded (/lib/systemd/system/mdmonitor.service; static; vendor preset: enabled)
25+
Active: active (running) since Sun 2024-08-18 23:10:19 CEST; 4s ago
26+
Main PID: 513 (mdadm)
27+
Tasks: 1 (limit: 2333)
28+
CGroup: /system.slice/mdmonitor.service
29+
└─513 /sbin/mdadm --monitor --scan
30+
31+
août 18 23:10:19 ubuntu systemd[1]: Started MD array monitor.
32+
chrichri@ubuntu:~$ lsblk
33+
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
34+
fd0 2:0 1 4K 0 disk
35+
sda 8:0 0 16G 0 disk
36+
└─sda1 8:1 0 16G 0 part /
37+
sdb 8:16 0 500M 0 disk
38+
sdc 8:32 0 500M 0 disk
39+
chrichri@ubuntu:~$ mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
40+
mdadm: must be super-user to perform this action
41+
chrichri@ubuntu:~$ sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
42+
mdadm: Note: this array has metadata at the start and
43+
may not be suitable as a boot device. If you plan to
44+
store '/boot' on this device please ensure that
45+
your boot-loader understands md/v1.x metadata, or use
46+
--metadata=0.90
47+
Continue creating array? y
48+
mdadm: Defaulting to version 1.2 metadata
49+
mdadm: array /dev/md0 started.
50+
chrichri@ubuntu:~$ sudo mdadm --detail /dev/md0
51+
/dev/md0:
52+
Version : 1.2
53+
Creation Time : Sun Aug 18 23:12:16 2024
54+
Raid Level : raid1
55+
Array Size : 510976 (499.00 MiB 523.24 MB)
56+
Used Dev Size : 510976 (499.00 MiB 523.24 MB)
57+
Raid Devices : 2
58+
Total Devices : 2
59+
Persistence : Superblock is persistent
60+
61+
Update Time : Sun Aug 18 23:12:20 2024
62+
State : clean
63+
Active Devices : 2
64+
Working Devices : 2
65+
Failed Devices : 0
66+
Spare Devices : 0
67+
68+
Consistency Policy : resync
69+
70+
Name : ubuntu:0 (local to host ubuntu)
71+
UUID : 96392d50:82158fec:ce097da1:81724f01
72+
Events : 17
73+
74+
Number Major Minor RaidDevice State
75+
0 8 16 0 active sync /dev/sdb
76+
1 8 32 1 active sync /dev/sdc
77+
chrichri@ubuntu:~$ mkfs.ext4 /dev/md0
78+
mke2fs 1.44.1 (24-Mar-2018)
79+
Impossible d'ouvrir /dev/md0 : Permission non accordée
80+
chrichri@ubuntu:~$ sudo mkfs.ext4 /dev/md0
81+
mke2fs 1.44.1 (24-Mar-2018)
82+
Rejet des blocs de périphérique : complété
83+
En train de créer un système de fichiers avec 510976 1k blocs et 128016 i-noeuds.
84+
UUID de système de fichiers=7f5ee0b6-99d9-497f-a87a-0505e7d42e16
85+
Superblocs de secours stockés sur les blocs :
86+
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
87+
88+
Allocation des tables de groupe : complété
89+
Écriture des tables d'i-noeuds : complété
90+
Création du journal (8192 blocs) : complété
91+
Écriture des superblocs et de l'information de comptabilité du système de
92+
fichiers : complété
93+
94+
chrichri@ubuntu:~$ lsblk
95+
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
96+
fd0 2:0 1 4K 0 disk
97+
sda 8:0 0 16G 0 disk
98+
└─sda1 8:1 0 16G 0 part /
99+
sdb 8:16 0 500M 0 disk
100+
└─md0 9:0 0 499M 0 raid1
101+
sdc 8:32 0 500M 0 disk
102+
└─md0 9:0 0 499M 0 raid1
103+
chrichri@ubuntu:~$ df /dev/md0
104+
df: /dev/md0: Aucun fichier ou dossier de ce type
105+
chrichri@ubuntu:~$ sudo mount /dev/md0 /mnt
106+
chrichri@ubuntu:~$ df /dev/md0
107+
Sys. de fichiers blocs de 1K Utilisé Disponible Uti% Monté sur
108+
/dev/md0 484306 14 454648 1% /mnt

0 commit comments

Comments
 (0)