Agrandir la partition
-
Etape :
# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" # df -h Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur udev 7,7G 0 7,7G 0% /dev tmpfs 1,6G 552K 1,6G 1% /run /dev/sda1 58G 25G 31G 45% / tmpfs 7,7G 0 7,7G 0% /dev/shm tmpfs 5,0M 0 5,0M 0% /run/lock tmpfs 1,6G 0 1,6G 0% /run/user/1000 # apt-get install cloud-guest-utils xfsprogs # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 80G 0 disk ├─sda1 8:1 0 59G 0 part / ├─sda2 8:2 0 1K 0 part └─sda5 8:5 0 975M 0 part [SWAP] sr0 11:0 1 1024M 0 rom # growpart /dev/sda 1 FAILED: sfdisk not found # dpkg -L fdisk | grep bin /sbin /sbin/cfdisk /sbin/fdisk /sbin/sfdisk # export PATH=$PATH:/sbin # growpart /dev/sda 1 /usr/bin/growpart: 242: Illegal number: 85899345920 octets, # /usr/sbin/resize2fs /dev/sda1 resize2fs 1.46.2 (28-Feb-2021) The filesystem is already 15478272 (4k) blocks long. Nothing to do! # LC_ALL=C growpart /dev/sda 1 NOCHANGE: partition 1 could only be grown by 2046 [fudge=2048] -
Je veux passer de 80 Go à 120 Go ( donc +30 Go sur mon sda1 => 90 Go)
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 120G 0 disk ├─sda1 8:1 0 59G 0 part / ├─sda2 8:2 0 1K 0 part └─sda5 8:5 0 975M 0 part [SWAP] sr0 11:0 1 1024M 0 rom # /sbin/cfdisk /dev/sda -
# lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda ├─sda1 ext4 1.0 5551ca5c-bc46-49d3-9c46-6d7c8ef6edd2 30,7G 42% / ├─sda2 └─sda5 swap 1 2b90308c-19e5-4437-80c1-c3c6fb0b4e2b [SWAP] sr0 # swapoff /dev/sda5 # gdisk /dev/sda GPT fdisk (gdisk) version 1.0.6 Warning: Partition table header claims that the size of partition table entries is 1119092736 bytes, but this program supports only 128-byte entries. Adjusting accordingly, but partition table may be garbage. Warning: Partition table header claims that the size of partition table entries is 0 bytes, but this program supports only 128-byte entries. Adjusting accordingly, but partition table may be garbage. Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: not present *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if you don't want to convert your MBR partitions to GPT format! *************************************************************** Command (? for help): -
# lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda ├─sda1 ext4 1.0 5551ca5c-bc46-49d3-9c46-6d7c8ef6edd2 30,7G 42% / ├─sda2 └─sda3 sr0 # mkswap /dev/sda3 Configure l'espace d'échange (swap) en version 1, taille = 5 GiB (5367635968 octets) pas d'étiquette, UUID=05776679-d503-4e26-b7e5-7cd492fe3acb # lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda ├─sda1 ext4 1.0 5551ca5c-bc46-49d3-9c46-6d7c8ef6edd2 30,7G 42% / ├─sda2 └─sda3 swap 1 05776679-d503-4e26-b7e5-7cd492fe3acb sr0 # swapon /dev/sda3 # partprobe /dev/sda # resize2fs /dev/sda1 resize2fs 1.46.2 (28-Feb-2021) Filesystem at /dev/sda1 is mounted on /; on-line resizing required old_desc_blocks = 8, new_desc_blocks = 14 The filesystem on /dev/sda1 is now 28835840 (4k) blocks long. # lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda ├─sda1 ext4 1.0 5551ca5c-bc46-49d3-9c46-6d7c8ef6edd2 78,8G 22% / ├─sda2 └─sda3 swap 1 05776679-d503-4e26-b7e5-7cd492fe3acb [SWAP] sr0 -
C’est bon !
# df -h Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur udev 12G 0 12G 0% /dev tmpfs 2,3G 560K 2,3G 1% /run /dev/sda1 108G 25G 79G 24% / tmpfs 12G 0 12G 0% /dev/shm tmpfs 5,0M 0 5,0M 0% /run/lock tmpfs 2,3G 0 2,3G 0% /run/user/1000
Bonjour ! Vous semblez intéressé par cette conversation, mais vous n’avez pas encore de compte.
Marre de refaire défiler les mêmes messages ? Créez un compte pour retrouver votre position, recevoir des notifications des nouvelles réponses, sauvegarder vos favoris et voter pour les messages que vous appréciez.
Grâce à votre participation, ce message peut devenir encore meilleur 💗
S'inscrire Se connecter