Unable to mount new filesystems created in resized space
Posted: 30. Mar 2018, 03:18
Has anyone seen the problem where after resizing a vdi, filesystems on partitions within the expanded disk space fail to mount?
I have spent days now on this problem and have googled extensively as well as searched these forums.
My host is running VirtualBox 5.0 on CentOS 7.3. My guest is SLES 12 SP1. My VM is a vdi with snapshots.
My guest has 100GB but I needed to increase the disk to 200GB to accomodate a large data set. I expanded the "Current State" "snapshot" with vboxmanage modifyhd '{0e60a57b-83c4-45e0-94b9-ad50778b1d8c}.vdi' --resize 204800.
This seemed to work fine. I could see it in the settings and when I started the VM, I could see the 200GB space with fdisk, parted, etc.
However, if I create a new primary partition in the expanded space, any filesystem that I create in that partition will fail to mount (giving all kinds of errors, but typically references to bad superblock etc.).
If I create a partition in the "old" (pre-expanded/first 100GB) space, an associated filesystem mounts fine. But if I create a partition in the newly expanded space (in the 100GB or higher range of the disk (/dev/sda)), an associated filesystem will not mount. This is not a function of the filesystem, as I have tried ext4, xfs, btrfs, etc. This is not a function of the partitioning agent as I have used fdisk, parted, gparted, and various versions of each. I have tried with and without Host I/O Caching enabled.
Here is a typical experience:
[vbox-head-sles12:~ #] parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mkpart primary ext4 60GiB 75GiB
(parted) mkpart primrKary ext4 110GiB 125GiB
(parted) u GiB
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 200GiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 0.00GiB 2.01GiB 2.01GiB primary linux-swap(v1) type=82
2 2.01GiB 41.4GiB 39.4GiB primary btrfs boot, type=83
3 60.0GiB 75.0GiB 15.0GiB primary ext4 type=83
4 110GiB 125GiB 15.0GiB primary type=83
(parted) q
Information: You may need to update /etc/fstab.
[vbox-head-sles12:~ #] mkfs -t ext4 /dev/sda3
mke2fs 1.42.11 (09-Jul-2014)
Creating filesystem with 3932160 4k blocks and 983040 inodes
Filesystem UUID: 46a9bfe2-227b-49ed-9a75-5b46e46541f5
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: done120
Writing inode tables: done120
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done120
[vbox-head-sles12:~ #] mkfs -t ext4 /dev/sdaK4
mke2fs 1.42.11 (09-Jul-2014)
Creating filesystem with 3932160 4k blocks and 983040 inodes
Filesystem UUID: 1b866828-587b-4581-a07d-bdfea3f3b41a
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: done120
Writing inode tables: done120
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done120
[vbox-head-sles12:~ #] mount /dev/sda3 /mnt/home3
[vbox-head-sles12:~ #] mount /dev/sda4 /mnt/home4
mount: wrong fs type, bad option, bad superblock on /dev/sda4,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
I have spent days now on this problem and have googled extensively as well as searched these forums.
My host is running VirtualBox 5.0 on CentOS 7.3. My guest is SLES 12 SP1. My VM is a vdi with snapshots.
My guest has 100GB but I needed to increase the disk to 200GB to accomodate a large data set. I expanded the "Current State" "snapshot" with vboxmanage modifyhd '{0e60a57b-83c4-45e0-94b9-ad50778b1d8c}.vdi' --resize 204800.
This seemed to work fine. I could see it in the settings and when I started the VM, I could see the 200GB space with fdisk, parted, etc.
However, if I create a new primary partition in the expanded space, any filesystem that I create in that partition will fail to mount (giving all kinds of errors, but typically references to bad superblock etc.).
If I create a partition in the "old" (pre-expanded/first 100GB) space, an associated filesystem mounts fine. But if I create a partition in the newly expanded space (in the 100GB or higher range of the disk (/dev/sda)), an associated filesystem will not mount. This is not a function of the filesystem, as I have tried ext4, xfs, btrfs, etc. This is not a function of the partitioning agent as I have used fdisk, parted, gparted, and various versions of each. I have tried with and without Host I/O Caching enabled.
Here is a typical experience:
[vbox-head-sles12:~ #] parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mkpart primary ext4 60GiB 75GiB
(parted) mkpart primrKary ext4 110GiB 125GiB
(parted) u GiB
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 200GiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 0.00GiB 2.01GiB 2.01GiB primary linux-swap(v1) type=82
2 2.01GiB 41.4GiB 39.4GiB primary btrfs boot, type=83
3 60.0GiB 75.0GiB 15.0GiB primary ext4 type=83
4 110GiB 125GiB 15.0GiB primary type=83
(parted) q
Information: You may need to update /etc/fstab.
[vbox-head-sles12:~ #] mkfs -t ext4 /dev/sda3
mke2fs 1.42.11 (09-Jul-2014)
Creating filesystem with 3932160 4k blocks and 983040 inodes
Filesystem UUID: 46a9bfe2-227b-49ed-9a75-5b46e46541f5
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: done120
Writing inode tables: done120
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done120
[vbox-head-sles12:~ #] mkfs -t ext4 /dev/sdaK4
mke2fs 1.42.11 (09-Jul-2014)
Creating filesystem with 3932160 4k blocks and 983040 inodes
Filesystem UUID: 1b866828-587b-4581-a07d-bdfea3f3b41a
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: done120
Writing inode tables: done120
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done120
[vbox-head-sles12:~ #] mount /dev/sda3 /mnt/home3
[vbox-head-sles12:~ #] mount /dev/sda4 /mnt/home4
mount: wrong fs type, bad option, bad superblock on /dev/sda4,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.