On my 1and1 root cloud server I'm trying to extend my file system size after an upgrade. I should have 120gb instead of 70gb. I'm not very experienced with filesystem extending
I'm on Ubuntu 16.04.3 LTS
Steps I took
$ pvcreate /dev/sda3
$ vgextend vg00 /dev/sda3
root@localhost:~$ vgs
VG #PV #LV #SN Attr VSize VFree
vg00 2 2 0 wz--n- 119.52g 0
$ lvextend -l +100%FREE /dev/mapper/vg00-lv00
$ resize2fs /dev/mapper/vg00-lv00
this gives me the following error
root@localhost:~$ resize2fs /dev/mapper/vg00-lv00
resize2fs 1.42.13 (17-May-2015)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/vg00-lv00
Couldn't find valid filesystem superblock.
Here is what it currently looks like
root@localhost:~$ fdisk -l
Disk /dev/sda: 120 GiB, 128849018880 bytes, 251658240 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: 0x4a065104
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 999424 104857599 103858176 49.5G 8e Linux LVM
/dev/sda3 104857600 251658239 146800640 70G 8e Linux LVM
Disk /dev/mapper/vg00-lv01: 47.6 GiB, 51124371456 bytes, 99852288 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/mapper/vg00-lv00: 71.9 GiB, 77204553728 bytes, 150790144 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
Df -h gives me:
root@localhost:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 0 2.0G 0% /dev
tmpfs 395M 11M 384M 3% /run
/dev/mapper/vg00-lv01 47G 18G 28G 39% /
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/sda1 464M 146M 290M 34% /boot
****** EDIT *****
As sven pointed out correctly I have resized the wrong logical volume.
I want to remove it using
sudo lvremove /dev/vg00/lv00
which results in
Logical volume vg00/lv00 in use.
I'm assuming it is used by another process, so I did
root@localhost:~$ dmsetup info -c | grep lv00
vg00-lv01 252 1 L--w 1 1 0 LVM-bajqBKcCFFgPQp40yHNfmReEAFHXcXe03BdrfHZV1JCVJigtzDTs2eEC3Y2GCepy
and tried to grep the process
root@localhost:~$ lsof | grep 252,1
which does not find anything.
How can I remove the wrong logical volume?