Serveurs Privés Virtuels (VPS) - Increase root partition on VPS 2018
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Increase root partition on VPS 2018

Von
RemiD9
Erstellungsdatum 2018-09-20 18:01:52 (edited on 2024-09-04 14:11:43) in Serveurs Privés Virtuels (VPS)

Bonjour,

Je viens de migrer d'une VPS 2016 avec 10Go SSD vers une VPS 2018 qui dispose, elle, théoriquement de 20Go SSD. La machine est un Ubuntu 18.04.1 LTS
Une documentation OVH existe pour augmenter la taille de ma partition root pour utiliser l'intégralité de ce nouveau disque dur:
https://docs.ovh.com/fr/vps/repartitionner-vps-suite-upgrade/

J'ai répliqué les étapes mais je suis dans l'impossibilité d'obtenir 20Go sur ma partition root.
J'ai fait des tickets pour le signaler à OVH mais ils me disent que les 20Go sont alloués de leur coté, or je ne les vois dans aucun résultat de commande.
Sauriez-vous si il y a autre chose à faire?

**Un parted:**
```bash
sudo parted

GNU Parted 3.2
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
32.3kB 1049kB 1016kB Free Space
1 1049kB 10.7GB 10.7GB primary ext4 boot
```

**Un df:**
```bash
df -h

Filesystem Size Used Avail Use% Mounted on
udev 961M 0 961M 0% /dev
tmpfs 195M 1.1M 194M 1% /run
/dev/vda1 9.7G 8.4G 1.3G 87% /
tmpfs 973M 8.0K 973M 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 973M 0 973M 0% /sys/fs/cgroup
tmpfs 973M 0 973M 0% /run/shm
/dev/loop0 5.0M 5.0M 0 100% /snap/canonical-livepatch/41
/dev/loop1 5.0M 5.0M 0 100% /snap/canonical-livepatch/42
/dev/loop2 88M 88M 0 100% /snap/core/5328
/dev/loop3 87M 87M 0 100% /snap/core/5145
tmpfs 195M 0 195M 0% /run/user/1001
```

**Un lsblk:**
```bash
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 4.9M 1 loop /snap/canonical-livepatch/41
loop1 7:1 0 4.9M 1 loop /snap/canonical-livepatch/42
loop2 7:2 0 87.9M 1 loop /snap/core/5328
loop3 7:3 0 87M 1 loop /snap/core/5145
vda 252:0 0 10G 0 disk
└─vda1 252:1 0 10G 0 part /
```

Et enfin la manipulation de repartition en rescue mode sur la même VPS:
```bash
root@rescue-pro:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 254:0 0 3G 0 disk
└─vda1 254:1 0 3G 0 part /
vdb 254:16 0 10G 0 disk
└─vdb1 254:17 0 10G 0 part /mnt/vdb1
root@rescue-pro:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 2.9G 1.6G 1.2G 58% /
udev 10M 0 10M 0% /dev
tmpfs 393M 5.3M 388M 2% /run
tmpfs 982M 0 982M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 982M 0 982M 0% /sys/fs/cgroup
/dev/vdb1 9.7G 8.4G 1.3G 87% /mnt/vdb1
root@rescue-pro:~# umount /dev/vdb1
root@rescue-pro:~# umount /dev/vdb1
umount: /dev/vdb1: not mounted
root@rescue-pro:~# fdisk -u /dev/vdb

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


Command (m for help): v

Command (m for help): p
Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb1880105

Device Boot Start End Sectors Size Id Type
/dev/vdb1 * 2048 20971519 20969472 10G 83 Linux


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

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-20971519, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519):

Created a new partition 1 of type 'Linux' and of size 10 GiB.

Command (m for help): a
Selected partition 1
The bootable flag on partition 1 is enabled now.

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

root@rescue-pro:~# resize2fs /dev/vdb1
resize2fs 1.42.12 (29-Aug-2014)
Please run 'e2fsck -f /dev/vdb1' first.

root@rescue-pro:~# e2fsck -f /dev/vdb1
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
cloudimg-rootfs: 446643/1280000 files (2.0% non-contiguous), 2279651/2621184 blocks
```
La partition est toujours de 10Go à la fin de la manipulation.

Merci


3 Antworten ( Latest reply on 2018-09-23 15:31:35 Von
kyodev
)

peux tu comparer `sudo fdisl -l` avec `df -h` ?
il n'y aurait pas par hasard une partition non montée?

Bonsoir @kyodev
Voici le résultat de fdisk -l:

```bash
sudo fdisk -l

Disk /dev/loop0: 4.9 MiB, 5156864 bytes, 10072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 4.9 MiB, 5152768 bytes, 10064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 87 MiB, 91160576 bytes, 178048 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 87.9 MiB, 92164096 bytes, 180008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/vda: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb1880105

Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 20971519 20969472 10G 83 Linux
```

humm, demande à Ovh de t'expliquer où voient ils les 20Go...

@kyodev, merci pour ta réponse.

J'ai retenté la manipulation sans succès, avec lors de la création de la partition avec fdisk:

```bash
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-20971519, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519): +20G
Value out of range
```

Celà veut bien dire qu'il n'y a que les 10Go originels montés sur mon VPS?
Merci

je n'ai pas été assez clair, mais `fdisk -l` ne laisse apparaître qu'un disk de 10Go
donc oui, moi je ne vois pas où sont les 20Go