ajout script pour formater sdb (GPT/protective MBR)
This commit is contained in:
@@ -219,7 +219,14 @@ Maintenant on prépare un fstab utilisable quand on boote sur `sdb` dans le /etc
|
||||
br@deneb:/mnt$ cd /etc
|
||||
br@deneb:/etc$ sudo ln fstab fstab.root1
|
||||
br@deneb:/etc$ sudo cp fstab fstab.root2
|
||||
|
||||
br@deneb:/etc$ sudo emacs fstab.root2
|
||||
|
||||
br@deneb:/etc$ ls -l fst*
|
||||
-rw-r--r-- 2 root root 916 Jun 22 10:50 fstab
|
||||
-rw-r--r-- 2 root root 916 Jun 22 10:50 fstab.root1
|
||||
-rw-r--r-- 1 root root 916 Jun 22 10:49 fstab.root2
|
||||
|
||||
br@deneb:/etc$ cat fstab.root2
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@@ -264,6 +271,8 @@ br@deneb:/etc$ diff fstab.root{1,2}
|
||||
|
||||
### Création de filtres pour le script de copie de disques
|
||||
|
||||
Note: Le script de duplication de disque est sur mon [serveur gitea](https://git.bodiccea.tk/bruno/Tools/src/branch/master/bash/dup-live-disk.sh) et sur [github](https://github.com/braoult/Tools/blob/master/bash/dup-live-disk.sh).
|
||||
|
||||
#### partition root
|
||||
```
|
||||
br@deneb:~$ cat /.rsync-disk-copy
|
||||
@@ -296,7 +305,7 @@ br@deneb:/home/patrick$ sudo du -sm * | sort -n
|
||||
24505 Musique
|
||||
223081 Vidéos
|
||||
```
|
||||
Pour exclure des répertoires de la copie, il faudrait créer un fichier `.rsync-disk-copy` dans `~patrick` ( __Ça c'est le boulot de Patrick__), avec les répertoires à exclure de la copie. Par exemple, en virant tout ce qui dépasse 10G :
|
||||
Pour exclure des répertoires de la copie, il faudrait créer un fichier `.rsync-disk-copy` dans `~patrick` ( __ça c'est le boulot de Patrick__), avec les répertoires à exclure de la copie. Par exemple, en virant tout ce qui dépasse 10G :
|
||||
|
||||
```
|
||||
- /ml.faivre/
|
||||
@@ -312,6 +321,38 @@ Il est à noter que la partition `root` de `sdb` est trop petite. Donc il faudra
|
||||
|
||||
```
|
||||
root2: 30 Gb (ext4)
|
||||
swap2: 3 Gb (swap)
|
||||
swap2: 3 ou 4 Gb (swap)
|
||||
export2: le reste, c.a.d. 110-115 Gb (ext4)
|
||||
```
|
||||
|
||||
Si tu veux, au lieu d'utiliser `gparted`, tu pourrais le faire en ligne de commande. Voici un script qui fera ça:
|
||||
|
||||
``` bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
declare -i PARTCODE=2
|
||||
declare DEVICE=/dev/sdb
|
||||
|
||||
sgdisk \
|
||||
--clear \
|
||||
--new 1::+1M \
|
||||
--typecode=1:ef02 \
|
||||
--change-name=1:"grub $PARTCODE" \
|
||||
--new 2::+30G \
|
||||
--typecode=2:8300 \
|
||||
--change-name=2:"ext4 root $PARTCODE" \
|
||||
--new 3::+4G \
|
||||
--typecode=3:8200 \
|
||||
--change-name=3:"swap $PARTCODE" \
|
||||
--new 4::-0 \
|
||||
--typecode=4:8300 \
|
||||
--change-name=4:"ext4 export $PARTCODE" \
|
||||
--randomize-guids \
|
||||
--mbrtogpt \
|
||||
"$DEVICE"
|
||||
|
||||
wipefs -a "${DEVICE}1"
|
||||
mkfs.ext4 -L "root$PARTCODE" "${DEVICE}2"
|
||||
mkswap -L "swap$PARTCODE" "${DEVICE}3"
|
||||
mkfs.ext4 -L "export$PARTCODE" "${DEVICE}4"
|
||||
```
|
||||
|
Reference in New Issue
Block a user