Deutsch   English   Français   Italiano  
<sr9itn$dl8$2@shakotay.alphanet.ch>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!news.imp.ch!news.alphanet.ch!alphanet.ch!.POSTED.localhost!not-for-mail
From: Marc SCHAEFER <schaefer@alphanet.ch>
Newsgroups: fr.comp.os.linux.configuration
Subject: Re: sauvegarde de la racine
Date: Fri, 7 Jan 2022 14:32:23 -0000 (UTC)
Organization: Posted through ALPHANET
Message-ID: <sr9itn$dl8$2@shakotay.alphanet.ch>
References: <sr7elu$e2p$1@rasp.pasdenom.info> <sr7vr1$99m$1@ns507557.dodin.fr.nf> <sr91d7$oqt$1@rasp.pasdenom.info> <sr9bjm$gcr$1@ns507557.dodin.fr.nf> <sr9cia$hpr$3@shakotay.alphanet.ch> <sr9hhn$to1$1@rasp.pasdenom.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 7 Jan 2022 14:32:23 -0000 (UTC)
Injection-Info: shakotay.alphanet.ch; posting-host="localhost:127.0.0.1";
	logging-data="13992"; mail-complaints-to="usenet@alphanet.ch"
User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (Linux/4.19.0-18-amd64 (x86_64))
Cancel-Lock: sha256:iGCQ2SkhbuTsB/vwprt+5DmJObBrUCK4MkvCr1HSKM8=
Bytes: 3417
Lines: 65

yamo' <yamo@beurdin.invalid> wrote:
> On peut démonter /dev /run /sys /proc ?

en init s, probablement.

Sinon booter en init=/bin/bash

mais comme tu le dis, ton `système' est en chroot, il suffit donc de ne
pas le lancer.

> Il me semble qu'il y a une option dans rsync pour les éviter...

-x  ne traversera pas les points de montage

> J'ai copié tout ce qui est possible à chaud via un rsync (en évitant les
> boucles).

Si les applis étaient down, ok. Sinon, c'est là qu'un snapshot aurait
été utile (passage des applis en mode synchronisation, si existe,
snapshot, remise des applis en mode normal, backup du snapshot,
effacement du snapshot).

Mais le plus simple est en init s

Ca n'a pas forcément un rapport, mais voici un script pour sauvegarder
de manière crash-cohérente (== aussi bonne qu'avec un crash
immédiat) chaque host d'un mini-cloud:

for n in $(seq 1 5)
do
   the_debug "apu2-ds-0$n lock node-runner and freeze all containers"
   the_ssh $n root@apu2-ds-0$n \
       'su - schaefer -c "/data/docker/scripts/ds-freeze start"'
   if [ $? != 0 ]; then
      echo "$0: could not freeze $n; unfreezing and continuing"
      do_unfreeze $n # err. ign.
      continue
   fi

   the_ssh $n root@apu2-ds-0$n \
         'for s in root docker scratch; do /data/docker/scripts/lvm-snapshot-volume start /dev/vg1/$s; done'
   if [ $? != 0 ]; then
      echo "$0: snapshots failed: unfreeze and rm"
      do_unfreeze $n # err. ign.
      do_snapshot_rm $n # err. ign.
      continue
   fi

   the_debug "apu2-ds-0$n unfreeze and unlock"
   do_unfreeze $n # err. ign.

   # BUGS
   #    - might get other stuff mounted in /mnt, include?
   the_debug "apu2-ds-0$n rsync'ing all snapshots"
   $nice the_rsync --delete --numeric-ids -aH \
               apu2-ds-0$n:/mnt/. $dest/apu2-ds-0$n/.

   # remove the snapshots
   the_debug "apu2-ds-0$n remove all snapshots"
   do_snapshot_rm $n # err. ign.
done

PS: the_debug fait un echo si debug=1; the_ssh fait un ssh en gérant les
cas où une machine n'est pas accessible directement.
PS/2: le mini-cloud partage aussi des données en glusterfs, qui est
sauvegardée de manière indépendante, donc non host-cohérente.