Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I cloned and enlarged an existing virtual CentOS-6 disk by the following steps:

  1. Create 15GB virtual disk and mount the old and the new disks in GParted.
  2. In GParted copy boot, swap and ext3 partitions from the old disk to the new one.
  3. Mark the new boot partition with boot flag.
  4. Resize the new ext3 to bigger size.

I disconnected the old disk and connected the new one. Now I cannot boot the VirtualBox. I get a black screen. What seems to be the problem here?

Thanks.

share|improve this question
add comment

1 Answer

The problem is that you did not install a boot loader ( grub2 ) on the new disk. Also, why bother copying? Just make the existing virtual disk size larger instead of copying to a new one.

share|improve this answer
    
Doesn't copying all partitions also copy the boot loader? If I resize the ext3 partition how do I fix the file system or will it adapt automatically to the new size? –  Jack Feb 7 '12 at 18:16
    
@Jack no, on a typical msdos partitioned bios booting pc, the boot loader lives outside of any partition. After enlarging the virtual disk image, you need to expand the partition to use the new space. You can do this with gparted from a livecd ( so the partition isn't mounted ). –  psusi Feb 7 '12 at 23:12
    
@Jack Copying all partitions copies most of the bootloader, but not one critical bit, which is in the bootsector. You need to create a working boot sector, e.g. grub-install. –  Gilles Feb 7 '12 at 23:56
    
@Gilles, it also doesn't get the core image for grub2, or the stage1.5 for grub-legacy. –  psusi Feb 8 '12 at 2:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.