Hello,
I'm trying to reduce the virtual disk défined in my local-lvm storage. I succeed to shrink properly inside the host the partition.
I want to set vm-101-disk-0 to 10G.
After successfully reduce the partition size inside the VM via RescueCD .
I'm running the following command on Proxmox:
Here I don't understand why it found a GPT partition as it is Linux EXT4.
To be sure to not erase some data I tried to set with 12GB
After this step my disk are corrupted so I have to start again.
Here some information from my VM:
Any idea ?
I'm trying to reduce the virtual disk défined in my local-lvm storage. I succeed to shrink properly inside the host the partition.
I want to set vm-101-disk-0 to 10G.
Code:
lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
base-105-disk-0 pve Vri---tz-k 32.00g data
data pve twi-aotz-- <794.79g 59.92 3.06
[data_tdata] pve Twi-ao---- <794.79g
[data_tmeta] pve ewi-ao---- 8.11g
[lvol0_pmspare] pve ewi------- 8.11g
root pve -wi-ao---- 96.00g
swap pve -wi-ao---- 8.00g
vm-100-disk-0 pve Vwi-aotz-- 10.00g data 85.40
vm-100-disk-1 pve Vwi-aotz-- 650.00g data 56.24
vm-100-disk-2 pve Vwi-aotz-- 11.00g data 73.17
vm-100-disk-3 pve Vwi-aotz-- 3.00g data 48.06
vm-101-disk-0 pve Vwi-aotz-- 15.00g data 61.54
vm-102-disk-0 pve Vwi-aotz-- 10.00g data 41.48
vm-102-disk-1 pve Vwi-aotz-- 100.00g data 45.04
vm-104-disk-0 pve Vwi-aotz-- 32.00g data 64.27
After successfully reduce the partition size inside the VM via RescueCD .
I'm running the following command on Proxmox:
Code:
root@nuc:~# e2fsck -fy /dev/pve/vm-101-disk-0
e2fsck 1.44.5 (15-Dec-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/pve/vm-101-disk-0
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a gpt partition table in /dev/pve/vm-101-disk-0
Here I don't understand why it found a GPT partition as it is Linux EXT4.
To be sure to not erase some data I tried to set with 12GB
Code:
root@nuc:~# lvresize -L 12G /dev/pve/vm-101-disk-0
WARNING: Reducing active and open logical volume to 12.00 GiB.
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce pve/vm-101-disk-0? [y/n]: n
Logical volume pve/vm-101-disk-0 NOT reduced.
root@nuc:~# qm rescan
After this step my disk are corrupted so I have to start again.
Here some information from my VM:
Code:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 15G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 10G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 10G 0 lvm /
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1,9G 0 1,9G 0% /dev
tmpfs 394M 740K 393M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 9,8G 6,1G 3,3G 66% /
tmpfs 2,0G 0 2,0G 0% /dev/shm
tmpfs 5,0M 0 5,0M 0% /run/lock
tmpfs 2,0G 0 2,0G 0% /sys/fs/cgroup
/dev/sda2 976M 299M 610M 33% /boot
tmpfs 394M 0 394M 0% /run/user/1000
$ fdisk -l
Disk /dev/sda: 15 GiB, 16106127360 bytes, 31457280 sectors
Disk model: QEMU HARDDISK
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: gpt
Disk identifier: BE688D1E-F78C-4BFB-9E58-C28B100E3637
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 2101247 2097152 1G Linux filesystem
/dev/sda3 2101248 23066623 20965376 10G Linux filesystem
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 9,102 GiB, 10733223936 bytes, 20963328 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
Any idea ?
Last edited: