Estou tendo problemas para aumentar o tamanho de uma imagem de disco do Ubuntu. Eu sei que preciso executar os seguintes passos - pelo menos -:
$ # 1. resize the image using qemu-img
$ qemu-img resize linux-x86.img +12G
$ # this step succeeded
$ # 2. mount, chroot
$ sudo mount -o loop,offset=32256 linux-x86.img /mnt
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /dev /mnt/dev
$ cd /mnt
$ sudo chroot .
Agora, as etapas a seguir são executadas no chroot:
$ df -h
df: cannot read table of mounted file systems: No such file or directory
$ # fix this error
$ cp /proc/mounts /etc/mtab
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 496M 458M 13M 98% /
udev 2.0G 4.0K 2.0G 1% /dev
Você pode ver que o espaço disponível é de apenas 13M, embora eu tenha aumentado o tamanho da imagem para mais 12 GBs.
Eu tentei iniciar o fdisk, mas a tabela de partições estava vazia:
$ fdisk /dev/loop0
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa95b4787.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
The number of cylinders for this disk is set to 1631.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/loop0: 13.4 GB, 13421609472 bytes
255 heads, 63 sectors/track, 1631 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa95b4787
Device Boot Start End Blocks Id System
Command (m for help):
Aqui está o / etc / mtab para sua informação:
/dev/loop0 / ext2 rw,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=2010936k,nr_inodes=502734,mode=755 0 0
Além disso, aqui está a saída de "uname -a":
Linux ubuntu 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz GenuineIntel GNU/Linux
Alguém pode ajudar, por favor?