10.14 Mojave Redimensionner une partition APFS

zeltron54

Membre expert
Club iGen
29 Mars 2008
3 404
561
Lorraine
Bonjour,

J'aurais besoin d'un petit coup de main "Macomaniac merci"

Je voudrais redimensionner la partition Disk3s1 volume Mojave à 500 Go

Actuellement un fusion drive qui à été passé en APFS avec un disque contenant 2 contenair apfs et une partition Windows.
Tout fonctionne...
La partition "Mojave" de 65,1 Go me servait pour tester des applis avant leurs installation sur "macintosh HD" Je voudrais donc passer cette partition à 500 Go.

Bloc de code:
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         121.1 GB   disk0s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *3.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk2         2.7 TB     disk1s2
   3:                 Apple_APFS Container disk3         65.1 GB    disk1s3
   4:       Microsoft Basic Data BOOTCAMP                197.3 GB   disk1s4
   5:           Windows Recovery                         914.4 MB   disk1s5

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +2.9 TB     disk2
                                 Physical Stores disk0s2, disk1s2
   1:                APFS Volume Macintosh HD            376.3 GB   disk2s1
   2:                APFS Volume Preboot                 44.4 MB    disk2s2
   3:                APFS Volume Recovery                510.4 MB   disk2s3
   4:                APFS Volume VM                      2.9 GB     disk2s4

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +65.1 GB    disk3
                                 Physical Store disk1s3
   1:                APFS Volume Mojave                  29.7 GB    disk3s1
   2:                APFS Volume Preboot                 44.2 MB    disk3s2
   3:                APFS Volume Recovery                512.4 MB   disk3s3
   4:                APFS Volume VM                      4.3 GB     disk3s4
 
:coucou: zeltron

Ce volume -->
Bloc de code:
   1:                APFS Volume Mojave                  29.7 GB    disk3s1

  • a près de 30 Go d'occupation : on peut supprimer toutes ses données ?

Car pour effectuer ce que tu souhaites > il faut supprimer / recréer le Conteneur disk3 dont dépend ce volume.

- à la limite > on peut envisager une variante conservative : créer un Conteneur en position intermédaire (taille 435 Go) > cloner Mojave au volume du Conteneur médian > supprimer le Conteneur disk3 de Mojave > récupérer son espace au Conteneur médian => qui deviendrait le Conteneur2 d'une taille de 500 Go. Plus compliqué en nombre de démarches > mais logiquement valide aussi.​
 
@macomaniac :coucou:

Oui ce volume, et on peut tout supprimer.
Je prépare la partition pour une installation de Catalina lorsqu'il sortira en final.
 
D'accord. Il va falloir plusieurs commandes pour supprimer / recréer à la bonne taille.

Passe la commande (copier-coller - elle va jusqu'au list final) :
Bloc de code:
diskutil ap deleteContainer disk3 ; diskutil eraseVolume free null disk1s3 ; diskutil ap resizeContainer disk2 0b ; diskutil list

  • la commande supprime le Conteneur disk3 => ce qui reformate automatiquement la partition disk1s3 primaire avec un volume Untitled > supprime la partition reformatée > récupère son espace au Conteneur disk2 du Fusion Drive (et à la partition primaire disk1s2 qui était la donneuse d'espace sur le grand HDD) > réaffiche le tableau des disques

Poste tout l'affichage retourné (au cas où l'enchaînement aurait coincé quelque part - qu'on voie où).
 
Voila

Bloc de code:
Started APFS operation on disk3
Deleting APFS Container with all of its APFS Volumes
Unmounting Volumes
Unmounting Volume "Mojave" on disk3s1
Unmounting Volume "Preboot" on disk3s2
Unmounting Volume "Recovery" on disk3s3
Unmounting Volume "VM" on disk3s4
Deleting Volumes
Deleting Container
Wiping former APFS disks
Switching content types
Reformatting former APFS disks
Initialized /dev/rdisk1s3 as a 60 GB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk1s3
Finished APFS operation on disk3
Started erase on disk1s3 Untitled
Unmounting disk
Finished erase on disk1
Started APFS operation
Aligning grow delta to 65 063 862 272 bytes and targeting a new physical store size of 2 802 159 955 968 bytes
Determined the maximum size for the targeted physical store of this APFS Container to be 2 802 159 955 968 bytes
Resizing APFS Container designated by APFS Container Reference disk2
The specific APFS Physical Store being resized is disk1s2
Verifying storage system
Using live mode
Performing fsck_apfs -n -x -l -S /dev/disk0s2
Checking the container superblock
Checking the fusion superblock
Checking the EFI jumpstart record
Checking the space manager
Checking the space manager free queue trees
Checking the object map
Checking the Fusion data structures
Checking volume
Checking the APFS volume superblock
The volume Macintosh HD was formatted by hfs_convert (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
warning: apfs_num_other_fsobjects (91) is not valid (92)
Checking volume
Checking the APFS volume superblock
The volume Preboot was formatted by hfs_convert (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Checking volume
Checking the APFS volume superblock
The volume Recovery was formatted by diskmanagementd (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Checking volume
Checking the APFS volume superblock
The volume VM was formatted by apfs.util (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Verifying allocated space
The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Growing APFS Physical Store disk1s2 from 2 737 096 093 696 to 2 802 159 955 968 bytes
Modifying partition map
Growing APFS data structures
Finished APFS operation
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         121.1 GB   disk0s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *3.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk2         2.8 TB     disk1s2
   3:       Microsoft Basic Data BOOTCAMP                197.3 GB   disk1s4
   4:           Windows Recovery                         914.4 MB   disk1s5

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +2.9 TB     disk2
                                 Physical Stores disk0s2, disk1s2
   1:                APFS Volume Macintosh HD            376.3 GB   disk2s1
   2:                APFS Volume Preboot                 44.4 MB    disk2s2
   3:                APFS Volume Recovery                510.4 MB   disk2s3
   4:                APFS Volume VM                      2.9 GB     disk2s4
 
Opération réussie. On voit au passage que l'apfs du Conteneur du Fusion Drive est sans erreur > ce qui est une bonne chose.

Pour recréer un Conteneur apfs de 500 Go > je soupçonne qu'on ne peut pas directement formater en apfs > dans la mesure où il existe déjà un Conteneur apfs (du Fusion Drive) qui a une partition support sur le HDD (disque concerné). Il doit falloir créer une partition jhfs+ > puis convertir en apfs.

On adopte ce scénario à 2 temps. Passe la commande :
Bloc de code:
diskutil ap resizeContainer disk2 2420g jhfs+ Catalina 0b ; diskutil list disk1

  • la commande rétrécit le Fusion Drive à 2,42 To > et crée une partition sur le HDD (entre la partition apfs et la partition BOOTCAMP) de 500 Go (environ) > avec un volume jhfs+ intitulé Catalina > puis affiche la configuration du seul HDD

Poste le retour.
 
  • J’aime
Réactions: litobar71
J'avais oublié de t'avertir : avec un disque géant > et un paquet de données impliqué dans le volume à Macintosh HD partie prenante du rétrécissement -->

- l'opération de rétrécissement peut durer un bon moment !​
 
Effectivement , j'ai remarqué, C'est fini !

Bloc de code:
Started APFS operation
Aligning shrink delta to 503 283 027 968 bytes and targeting a new physical store size of 2 298 876 928 000 bytes
Determined the minimum size for the targeted physical store of this APFS Container to be 387 218 145 280 bytes
Resizing APFS Container designated by APFS Container Reference disk2
The specific APFS Physical Store being resized is disk1s2
Verifying storage system
Using live mode
Performing fsck_apfs -n -x -l -S /dev/disk0s2
Checking the container superblock
Checking the fusion superblock
Checking the EFI jumpstart record
Checking the space manager
Checking the space manager free queue trees
Checking the object map
Checking the Fusion data structures
Checking volume
Checking the APFS volume superblock
The volume Macintosh HD was formatted by hfs_convert (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
warning: apfs_num_other_fsobjects (91) is not valid (92)
Checking volume
Checking the APFS volume superblock
The volume Preboot was formatted by hfs_convert (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Checking volume
Checking the APFS volume superblock
The volume Recovery was formatted by diskmanagementd (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Checking volume
Checking the APFS volume superblock
The volume VM was formatted by apfs.util (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Verifying allocated space
The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Shrinking APFS Physical Store disk1s2 from 2 802 159 955 968 to 2 298 876 928 000 bytes
Shrinking APFS data structures
Shrinking partition
Modifying partition map
Initialized /dev/rdisk1s3 as a 469 GB case-insensitive HFS Plus volume with a 40960k journal
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk1s3
Finished APFS operation
/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *3.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk2         2.3 TB     disk1s2
   3:                  Apple_HFS Catalina                503.1 GB   disk1s3
   4:       Microsoft Basic Data BOOTCAMP                197.3 GB   disk1s4
   5:           Windows Recovery                         914.4 MB   disk1s5
 
Voici la nouvelle partition -->
Bloc de code:
   3:                  Apple_HFS Catalina                503.1 GB   disk1s3

  • 503 Go : on n'est pas loin du compte. Volume jhfs+ standard Catalina.
  • passe encore la commande :
Bloc de code:
diskutil ap convert disk1s3 ; diskutil list

  • qui convertit la partition à l'apfs > puis réaffiche le tableau complet de la configuration des disques

Poste le retour.
 
voila,
Une question : Il n'y a pas les 4 volumes ?
Bloc de code:
Converting the volume on disk1s3 to an APFS Volume on an APFS Container
Started APFS operation on disk1s3 Catalina
Converting HFS Volume to an APFS Container which will export one APFS Volume
The target is the Journaled HFS+ volume "Catalina" backed by the GPT partition disk1s3
The target is a data disk; it is not a macOS system disk
Found APFS EFI driver /usr/standalone/i386/apfs.efi to install into the APFS Container
The target is not encrypted
Unmounting disk1s3
Starting conversion from HFS to APFS
Performing apfs_hfs_convert -x --verbose=0x400 --efi /usr/standalone/i386/apfs.efi /dev/disk1s3
Reporting pre-conversion statistics
Reporting post-conversion statistics
Successfully finished conversion from HFS to APFS
Successful conversion in commit mode so will switch type to APFS
Setting type of disk1s3 to APFS
Changing the physical disk partition type in shared mode
Partition modification attempt count was 1
Opening and closing disk1s3 to terminate old content driver
Expecting the new APFS Container at Physical Store disk1s3
Confirmed existence of new unencrypted APFS Volume disk3s1
Mounting APFS Volume disk3s1
APFS Volume mount attempt result was 0
Exiting conversion operations with error code 0
Disk from APFS operation: disk3s1
Finished APFS operation on disk1s3 Catalina
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk2         121.1 GB   disk0s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *3.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk2         2.3 TB     disk1s2
   3:                 Apple_APFS Container disk3         503.1 GB   disk1s3
   4:       Microsoft Basic Data BOOTCAMP                197.3 GB   disk1s4
   5:           Windows Recovery                         914.4 MB   disk1s5

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +2.4 TB     disk2
                                 Physical Stores disk0s2, disk1s2
   1:                APFS Volume Macintosh HD            376.3 GB   disk2s1
   2:                APFS Volume Preboot                 44.4 MB    disk2s2
   3:                APFS Volume Recovery                510.4 MB   disk2s3
   4:                APFS Volume VM                      2.9 GB     disk2s4

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +503.1 GB   disk3
                                 Physical Store disk1s3
   1:                APFS Volume Catalina                978.9 KB   disk3s1
 
Tout est en ordre -->
Bloc de code:
   3:                 Apple_APFS Container disk3         503.1 GB   disk1s3

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +503.1 GB   disk3
                                 Physical Store disk1s3
   1:                APFS Volume Catalina                978.9 KB   disk3s1

  • la partition disk1s3 recèle un magasin de stockage primaire Physical Store. Il est importé comme base de données dans le Conteneur disk3 (même taille que la partition). Ce Conteneur exporte un seul volume Catalina (d'une taille extensible en fonction des données contenues).
  • Catalina n'a pour l'instant qu'un statut de volume apfs de stockage => il ne requiert donc pas de volumes auxiliaires pour être monté et accédé depuis un autre volume démarré. Dès qu'une installation d'OS aura été effectuée dans ce volume > il aura le statut de volume de démarrage et sera flanqué des 3 volumes auxiliaires : Preboot > Recovery > VM. Si c'est Catalina que tu installes > il y aura en plus un volume : Catalina - Données > l'OS Catalina impliquant une bifurcation des volumes principaux en : Catalina (Système) & Catalina - Données (données utilisateur). Au démarrage sur Catalina > cette bifrucation n'apparaît pas > le volume Catalina - Données se trouvant monté dans le volume de démarrage Catalina (at: /System/Volumes/Data).
 
Merci beaucoup ! :) ;)
Je vois que tu es toujours aussi demandé sur le forum !
Un GRAND MERCI à toi ! :coucou: :coucou: Toujours aussi efficace .... :D o_O