« Atelier SysRes SE2a5 2023/2024 E2 » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
|||
Ligne 67 : | Ligne 67 : | ||
== '''05/10/2023''' == | == '''05/10/2023''' == | ||
mkfs /dev/xvdb2 | * mkfs /dev/xvdb1 | ||
* mkfs /dev/xvdb2 | |||
mkdir new-var | * mkdir new-var | ||
* mkdir new-home | |||
mkdir new-home | * mount /dev/xvdb1 /new-home | ||
* mount /dev/xvdb2 /new-var | |||
mount /dev/xvdb1 /new-home | * mv /var/* /new-var/ | ||
* lsblk | |||
mount /dev/xvdb2 /new-var | <syntaxhighlight lang="linux-config"> | ||
lsblk<syntaxhighlight lang="linux-config"> | |||
xvda1 202:1 0 512M 0 disk [SWAP] | xvda1 202:1 0 512M 0 disk [SWAP] | ||
xvda2 202:2 0 10G 0 disk / | xvda2 202:2 0 10G 0 disk / | ||
Ligne 85 : | Ligne 82 : | ||
xvdb2 202:18 0 10G 0 disk /root/new-var | xvdb2 202:18 0 10G 0 disk /root/new-var | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* nano /etc/fstab | |||
<syntaxhighlight lang="linux-config"> | |||
/dev/xvdb1 /home ext2 defaults 0 2 | |||
/dev/xvdb2 /var ext4 defaults 0 2 | |||
</syntaxhighlight> | |||
lsblk<syntaxhighlight lang="linux-config"> | * umount /root/new-var | ||
* umount /root/new-home | |||
* mount -a | |||
* lsblk | |||
<syntaxhighlight lang="linux-config"> | |||
xvda1 202:1 0 512M 0 disk [SWAP] | xvda1 202:1 0 512M 0 disk [SWAP] | ||
xvda2 202:2 0 10G 0 disk / | xvda2 202:2 0 10G 0 disk / | ||
Ligne 97 : | Ligne 101 : | ||
xvdb2 202:18 0 10G 0 disk /var | xvdb2 202:18 0 10G 0 disk /var | ||
</syntaxhighlight>reboot | </syntaxhighlight> | ||
* reboot |
Version du 5 octobre 2023 à 13:56
IP : 172.26.145.112
13/09/2023 :
Création de la VM
xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp
- vi /etc/network/interfaces : remplacer DHCP par static
address 172.26.145.112/24
gateway 172.26.145.254
14/09/2023 :
Configuration
Configuration de l'interface:
nano /etc/network/interfaces
Modifications:
auto eth0
iface eth0 inet static
address 172.26.145.109/24
gateway 172.26.145.254
Création d’un conteneur à la main
Sous machine Zabeth:
su -
dd if=/dev/zero of=toto bs=1024k count=10240
mkfs /home/pifou/toto
mkdir tmp/mnt
mount -oloop /home/pifou/toto /tmp/mnt
apt install debootstrap
debootstrap stable /tmp/mnt
echo "proc /proc proc defaults 0 0" >> /tmp/mnt/etc/fstab
unshare -p -f -m chroot /tmp/mnt /bin/sh -c "mount /proc ; /bin/bash"
Docker
docker run -i -t debian /bin/bash
02/10/2023
- Configuration du ssh
nano /etc/ssh/sshd_config
PermitRootLogin yes
- Installer apache2 et bind9
lvcreate -L10G -nberlin-var virtual
lvcreate -L10G -nberlin-home virtual
05/10/2023
- mkfs /dev/xvdb1
- mkfs /dev/xvdb2
- mkdir new-var
- mkdir new-home
- mount /dev/xvdb1 /new-home
- mount /dev/xvdb2 /new-var
- mv /var/* /new-var/
- lsblk
xvda1 202:1 0 512M 0 disk [SWAP]
xvda2 202:2 0 10G 0 disk /
xvdb1 202:17 0 10G 0 disk /root/new-home
xvdb2 202:18 0 10G 0 disk /root/new-var
- nano /etc/fstab
/dev/xvdb1 /home ext2 defaults 0 2
/dev/xvdb2 /var ext4 defaults 0 2
- umount /root/new-var
- umount /root/new-home
- mount -a
- lsblk
xvda1 202:1 0 512M 0 disk [SWAP]
xvda2 202:2 0 10G 0 disk /
xvdb1 202:17 0 10G 0 disk /home
xvdb2 202:18 0 10G 0 disk /var
- reboot