Version 1.1 von Michael Ecer am 2021/08/29 10:24

Zeige letzte Bearbeiter
1 = (% style="color:#000000" %)bk1 und bk2(%%) =
2
3 === (% style="color:#000000" %)Das Einrichten der Backup Platten (aus der Dokumentation)(%%) ===
4
5 (% style="color:#000000" %)Festplatten anzeigen lassen und Backupfestplatte ausfindig machen
6
7 {{code language="bash"}}
8 fdisk -l
9 {{/code}}
10
11 (% style="color:#000000" %) Ausgabe an diesem Beispiel: (/dev/sdb ist hier die Festplatte, die nicht partitioniert ist)
12
13 {{code language="bash"}}
14 Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
15 Units: sectors of 1 * 512 = 512 bytes
16 Sector size (logical/physical): 512 bytes / 512 bytes
17 I/O size (minimum/optimal): 512 bytes / 512 bytes
18 Disklabel type: dos
19 Disk identifier: 0xcccd1553
20
21 Device Boot Start End Sectors Size Id Type
22 /dev/sda1 2048 2099199 2097152 1G fd Linux raid autodetect
23 /dev/sda2 2099200 35653631 33554432 16G fd Linux raid autodetect
24 /dev/sda3 35653632 1953525167 1917871536 914.5G fd Linux raid autodetect
25
26
27 Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
28 Units: sectors of 1 * 512 = 512 bytes
29 Sector size (logical/physical): 512 bytes / 512 bytes
30 I/O size (minimum/optimal): 512 bytes / 512 bytes
31 Disklabel type: dos
32 Disk identifier: 0xd4aba4f1
33
34
35 Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
36 Units: sectors of 1 * 512 = 512 bytes
37 Sector size (logical/physical): 512 bytes / 512 bytes
38 I/O size (minimum/optimal): 512 bytes / 512 bytes
39 Disklabel type: dos
40 Disk identifier: 0x27cd6ce3
41
42 Device Boot Start End Sectors Size Id Type
43 /dev/sdc1 2048 2099199 2097152 1G fd Linux raid autodetect
44 /dev/sdc2 2099200 35653631 33554432 16G fd Linux raid autodetect
45 /dev/sdc3 35653632 1953525167 1917871536 914.5G fd Linux raid autodetect
46 {{/code}}
47
48 (% style="color:#000000" %)Erstellen einer Partition über die gesamte Festplatte
49
50 {{code language="bash"}}
51 echo -e "n\np\n1\n\n\nt\n83\nw" | fdisk /dev/sdb
52 {{/code}}
53
54 (% style="color:#000000" %) Erklärung:
55
56 {{code language="bash"}}
57 echo -e "n\np\n1\n\n\nt\n83\nw" =
58 n (new partition)
59 p (primary partition)
60 1 (number of partition)
61 (first bit)
62 (last bit)
63 t (set type)
64 83 (choose type 83 = Linux)
65 w (write to disk)
66 {{/code}}
67
68 (% style="color:#000000" %) Formatieren der Partition mit dem Dateisystem EXT3 und vergeben das Label bk1 oder bk2 (in Berlin standardmäßig immer bk1, weil es gibt nur eine Backupfestplatte)
69
70 {{code language="bash"}}
71 mkfs.ext4 -L bk1 /dev/sdb1
72 {{/code}}
73
74 (% style="color:#000000" %) Anpassen der EXT3 Dateisystem Parameter für die Partition
75
76 {{code language="bash"}}
77 tune2fs -i0 -c0 /dev/sdb1
78 {{/code}}
79
80 (% style="color:#000000" %)Backuppartition ausmounten, da nur Leserechte
81
82 {{code language="bash"}}
83 umount /backup/bk1
84 {{/code}}
85
86 (% style="color:#000000" %)Backuppartition manuell einmounten, um Schreibrechte zu erlangen
87
88 {{code language="bash"}}
89 mount -L bk1 /backup/bk1
90 {{/code}}
91
92 (% style="color:#000000" %)Ordner "snapshot" auf der Backupfestplatte erstellen
93
94 {{code language="bash"}}
95 mkdir /backup/bk1/snapshot
96 {{/code}}
97
98 (% style="color:#000000" %)Backuppartition ausmounten
99
100 {{code language="bash"}}
101 umount /backup/bk1
102 {{/code}}
103
104 (% style="color:#000000" %) screen erstellen
105
106 {{code language="bash"}}
107 screen
108 {{/code}}
109
110 (% style="color:#000000" %) Erstellen Sie einen manuellen Snapshot daily_bk1 oder daily_bk2 (optional)
111
112 (% style="color:#000000" %) ldsnapshot [ daily_bk1 | daily_bk2 ]
113
114
115 {{code language="bash"}}
116 ldsnapshot daily_bk1
117 {{/code}}
118
119 === (% style="color:#000000" %)Format:(%%) ===
120
121 (% style="color:#000000" %) Ext4 -> aufgrund des Journaling, dadurch wird die Dateiüberprüfung beschleunigt.
122
123 === (% style="color:#000000" %)Label:(%%) ===
124
125 (% style="color:#000000" %)**Das Label der internen Backup-Platten muss lauten: "bk1" oder/und "bk2"**
126
127 === (% style="color:#000000" %)Aufbau:(%%) ===
128
129 (% style="color:#000000" %)Sollte eine Festplatte in logoDIDACT eines dieser Label verwenden, so wird sie vom System für regelmäßige Backups genutzt.
130 \\Das Backupscript ist standartmäßig so eingestellt (in '/etc/cron.d/backup') das es
131
132 {{code language="bash"}}
133 Montag "Dienstag" Mittwoch "Donnerstag" Freitag um 0.22 ldsnapshot für BK1 ausführt und
134
135 "Montag" Dienstag "Mittwoch" Donnerstag "Freitag" um 0.22 ldsnapshot für BK2 ausführt.
136 {{/code}}
137
138 (% style="color:#000000" %) Sollte BK1 oder BK2 nicht vorhanden sein wird die jeweils vorhandene Backup-Platte, für die Sicherung genutzt.
139
140 (% style="color:#000000" %)Es ist nicht unbedingt nötig, dass nur interne Festplatten das Label bekommen dürfen. Es kann auch eine externe USB-Festplatte mit diesem Label ausgestattet sein, nur muss die Platte dann um 0.22 am Server hängen um ein Update durchzuführen.