Ergebnis 1 bis 4 von 4
-
20.07.2021, 22:24 #1
- Registriert seit
- 11.02.2020
- Ort
- here and there
- Beiträge
- 2.424
- Thanks (gegeben)
- 642
- Thanks (bekommen)
- 1648
- Total Downloaded
- 0
- Total Downloaded
- 0
Box 1:Mutant HD2400Box 2:VU Ultimo 4KBox 3:Octagon SF8008Box 4:Gigablue Quad 4KBox 5:VDRInitialisieren über telnet bzw. ssh
Hi,
Habe ein Script geschrieben um das Initialisieren eines Mediums (Festplatte/ USB Stick/SD-Karte)
über telnet oder ssh erledigen zu können, es nennt sich initialize_media_de.sh.
first hint -> for english speaking users i post the same script but in english in my next post #2
in german -> für die englisch sprechenden Anwender poste ich das selbe Script in englischer Sprache in meinem nächsten Post #2 hier.
HINWEIS !
Mir ist schon klar das man Datenträger direkt an der Box über das passende Menü initialisieren kann, deshalb soll das hier lediglich eine Alternative dazu darstellen.
Konfiguriert wird das Ganze wie folgt;
1.)
Zunächst muss im Script initialize_media_de.sh die Variable in Zeile 7 nämlich;
DEV=sdx auf das korrekte Device (Gerät) welches initialisiert werden soll geändert werden.
z.b: auf DEV=sdc oder DEV=sdd oder welches Device auch immer.
Dies sollte man nur mit einem Linuxtauglichen Editor wie z.b: Notepad++ tun.
Es bleibt dem User überlassen wie man rausfindet weches Device das richtige ist das initialisiert werden soll.
Nur soviel, man bekommt das leicht heraus indem man die Ausgaben des telnet/ssh Befehls mount
abgleicht, (vorher/nachher also mount Ausgabe vorm anstecken eines neuen Datenträgers und danach vergleichen).
Aber bitte aufpassen -> wählt man das falsche Device sind nach dem Initialisieren alle Daten
die da drauf waren weg.
Doch gibt es im Script (arbeitet ein bisschen interaktiv) ganz am Anfang selbst noch eine Sicherheitsabfrage diesbzgl. bevor wirklich initialisiert wird, hier
hat man also noch einmal eine letzte Chance abzubrechen indem man die Frage mit n oder N für nein beantwortet gefolgt von einem Druck auf die Enter Taste,
wenn man unsicher ist ob man das korrekte Device konfiguriert (eingestellt) hat.
2.)
Nun das Script an der Box nach /usr/script kopieren und mit folgendem telnet/ssh Befehl ausführbar machen;
Code:chmod 755 /usr/script/initialize_media_de.sh
Angewendet wird das Script wie folgt;
Das Script wird mit folgendem telnet/ssh Befehl gestartet;
Code:sh /usr/script/initialize_media_de.sh
WARNUNG -> Wurde das falsche Device ausgewaehlt sind nach dem
Initialisieren alle Daten darauf unwiederbringlich verloren.
Sicher das sdb das korrekte Device ist welches initialisiert werden soll ?
wobei sdb ist nur ein Beispiel in dieser Nachricht.
Hier also wie bereits erwähnt, falls man unsicher ist ob man das korrekte Device zum Initialisieren eingestellt hat
mit n oder N für nein antworten und die Enter Taste drücken, dann bricht das Script einfach ab und tut gar nix weiter.
Beantwortet man die Frage hingegen mit y oder Y für ja gibts kein Zurück mehr, dann wird initialisiert.
Antwortet man mit irgendwas anderem als mit n bzw. N für nein oder eben y bzw. Y für ja
bekommt man folgenden Hinweis;
Bitte mit y fuer (yes) oder n fuer (nein) antworten.
In dem Fall geht es erst weiter wenn man korrekt antwortet.
Hier mal ein Bild dazu;
Das wärs dann auch eigentlich, mehr gibts dazu nicht mehr zu sagen ausser;
Ich übernehme keine Gewähr wenn jemand aus Versehen oder was auch immer das falsche Device initialisiert.
EDIT ! Update -> neue Version vom 12.01.2022 (bugfix falls vor dem Initialisieren mehr als 9 Partitionen vorhanden waren).
Grüsse
PikeGeändert von Pike_Bishop (12.01.2022 um 01:05 Uhr)
-
Danke - 3 Thanks
-
Advertising
-
20.07.2021, 22:48 #2
- Registriert seit
- 11.02.2020
- Ort
- here and there
- Beiträge
- 2.424
- Thanks (gegeben)
- 642
- Thanks (bekommen)
- 1648
- Total Downloaded
- 0
- Total Downloaded
- 0
ThemenstarterBox 1:Mutant HD2400Box 2:VU Ultimo 4KBox 3:Octagon SF8008Box 4:Gigablue Quad 4KBox 5:VDRHi,
now the same as in post #1 but in english language.
i have written a script to initialize your device with telnet or ssh, it is named initialize_media_en.sh
HINT !
i know you can initialize a device anyway directly on the box about the menu thereto, and therefore this is only an other option to do the same job.
Configuration;
1.)
so that it works first you must edit it in line 7 (only with a unix compatible editor, as example with notepad++) and change that;
DEV=sdx
to the correct device which you want to initialize, as example to DEV=sdc or DEV=sdd or whatever.
it's up to you to find out which is the correct device which you want to initialize, but please be careful,
because if you select the incorrectness device after initializing it all partitions and data are lost on it.
2.)
after the script is correct edited you must copy the script on your box to /usr/script
and make it then executable in telnet or ssh as following;
Code:chmod 755 /usr/script/initialize_media_en.sh
Usage;
now you can start the script in telnet or ssh with the command;
Code:sh /usr/script/initialize_media_en.sh
WARNING -> if you selected the incorrectness device
to initialize all data are lost on this device.
are you sure that sdb is the correct device which you want to initialize?
whereby sdb is only a example in this message.
this is a last safety query if you have selected the correct device which you want to initialize
if you are unsure then answer now with n for no (so press the key n or N and then the Enter Key)
in this case the script does nothing and ends.
if you instead press the key y or Y for yes and then the Enter Key the script now initialize the selected device
which you have defined in the script in line 7 at point 1.) above in this post.
if you answer with something others as n or N for no respectively y or Y for yes then a message is coming as;
please answer with y for (yes) or n for (no).
in this case the script runs only further if you answer correct.
here a picture thereto;
that's all, and at last -> no guarantee can be given if a user select the incorrectness device to initialize.
EDIT ! Update -> new version from 12.01.2022 (bugfix in case if 9 partitions available before initialize).
regards
PikeGeändert von Pike_Bishop (12.01.2022 um 01:05 Uhr)
-
Danke - 1 ThanksMr.Servo bedankten sich
-
15.09.2021, 22:18 #3
- Registriert seit
- 11.02.2020
- Ort
- here and there
- Beiträge
- 2.424
- Thanks (gegeben)
- 642
- Thanks (bekommen)
- 1648
- Total Downloaded
- 0
- Total Downloaded
- 0
ThemenstarterBox 1:Mutant HD2400Box 2:VU Ultimo 4KBox 3:Octagon SF8008Box 4:Gigablue Quad 4KBox 5:VDRHi,
Neue verbesserte Versionen der beiden Scripts, die arbeiten nun komplett interaktiv um das korrekte Device auszuwählen (es muss nun nichts mehr im Script angepasst werden).
PUNKT 1.) aus Post #1 entfällt also.
Das korrekte Device muss stattdessen beim Ausführen des Scripts in telnet bzw. ssh angegeben werden.
Im angehängten Paket sind jetzt beide Scripte (die deutsche und die englische Version)
EDIT ! Update -> neue Versionen vom 12.01.2022 (bugfix falls vor dem Initialisieren mehr als 9 Partitionen vorhanden waren).
for english speaking users;
new improved versions from both scripts, they works complete interactive now to select the correct device (not need to edit the script anymore).
POINT 1.) from post #2 is obsolete.
the correct device now you must select by the execution from the script in telnet respectively ssh.
in the attached package are now both scripts (the german and the english version).
EDIT ! Update -> new versions from 12.01.2022 (bugfix in case if 9 partitions available before initialize).
Grüsse (regards) PikeGeändert von Pike_Bishop (12.01.2022 um 18:19 Uhr)
-
Danke - 1 ThanksMr.Servo bedankten sich
-
12.01.2022, 01:10 #4
- Registriert seit
- 11.02.2020
- Ort
- here and there
- Beiträge
- 2.424
- Thanks (gegeben)
- 642
- Thanks (bekommen)
- 1648
- Total Downloaded
- 0
- Total Downloaded
- 0
ThemenstarterBox 1:Mutant HD2400Box 2:VU Ultimo 4KBox 3:Octagon SF8008Box 4:Gigablue Quad 4KBox 5:VDRUpdate neue Versionen vom 12.01.2022 in den Posts darüber zu finden.
Update new versions from 12.01.2022 in the posts above to find.
Grüsse (regards) Pike
-
Danke - 1 Thankskueken bedankten sich
Lesezeichen