lundi 8 septembre 2025

luc330 backup server laptop

Situation des disques

luc@luc330:~$ sudo fdisk -l
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10SPZX-24Z
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 39070048-E214-45DE-B5D4-1B722D7445A2

Device       Start        End    Sectors   Size Type
/dev/sda1     2048    2203647    2201600     1G EFI System
/dev/sda2  2203648    6397951    4194304     2G Linux filesystem
/dev/sda3  6397952 1953521663 1947123712 928.5G Linux filesystem


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdb: 7.28 TiB, 8001563221504 bytes, 15628053167 sectors
Disk model: Expansion HDD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 01000000-0000-0000-4E54-31374D5A4744

Device      Start         End     Sectors  Size Type
/dev/sdb1      40      409639      409600  200M EFI System
/dev/sdb2  411648 15628052479 15627640832  7.3T Linux filesystem


Disk /dev/sdc: 3.64 TiB, 4000787030016 bytes, 976754646 sectors
Disk model: External USB 3.0
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33550336 bytes
Disklabel type: dos
Disk identifier: 0x89dcfabb

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdc1        8191 976754645 976746455  3.6T 83 Linux
 

Utilisation des disques

luc@luc330:~$ df -lm | grep ^/dev
/dev/mapper/ubuntu--vg-ubuntu--lv    100221   11211     83875  12% /
/dev/sda2                              1946     193      1635  11% /boot
/dev/sda1                              1073       7      1067   1% /boot/efi
/dev/sdb2                           7630684 2271655   5358698  30% /var/backups/rsync

Vérification des systèmes de fichiers

luc@luc330:~$ sudo umount /dev/sdb2
luc@luc330:~$ sudo btrfs check /dev/sdb2
Opening filesystem to check...
Checking filesystem on /dev/sdb2
UUID: f244899d-a9c4-4fec-a7f6-f0762b21b7eb
[1/7] checking root items
[2/7] checking extents

[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 2378677673984 bytes used, no error found
total csum bytes: 2320204984
total tree bytes: 2787770368
total fs tree bytes: 349306880
total extent tree bytes: 59326464
btree space waste bytes: 105155488
file data blocks allocated: 2375889903616
 referenced 2375889903616

luc@luc330:~$ sudo mount -a

Préparation de l'usage du disque externe 4 TB

 luc@luc330:~$ sudo pvcreate /dev/sdc
  Cannot use /dev/sdc: device is partitioned
luc@luc330:~$ sudo mount /dev/sdc1 /mnt
luc@luc330:~$ ls /mnt
luc@luc330:~$ df -lm /dev/sdc1
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/sdc1        3815416     6   3813351   1% /mnt
luc@luc330:~$ sudo umount /dev/sdc1
luc@luc330:~$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.39.3).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

luc@luc330:~$ sudo pvcreate /dev/sdc
WARNING: dos signature detected on /dev/sdc at offset 510. Wipe it? [y/n]: y
  Wiping dos signature on /dev/sdc.
  Physical volume "/dev/sdc" successfully created.
luc@luc330:~$ sudo vgcreate vgHome /dev/sdc
  Volume group "vgHome" successfully created
luc@luc330:~$ sudo lvcreate -L 3T -n lvHome vgHome
WARNING: btrfs signature detected on /dev/vgHome/lvHome at offset 65600. Wipe it? [y/n]: y
  Wiping btrfs signature on /dev/vgHome/lvHome.
  Logical volume "lvHome" created.
luc@luc330:~$ sudo mkfs.ext4 /dev/vgHome/lvHome
mke2fs 1.47.0 (5-Feb-2023)
Creating filesystem with 805306368 4k blocks and 201326592 inodes
Filesystem UUID: d070149d-7779-4709-b95c-820cd677a350
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

luc@luc330:~$ sudo mount /dev/