-   Linux - Newbie (
-   -   Want to swap the booting disk showing in Linux VMware (

amit.agrawal21 08-22-2012 02:00 PM

Want to swap the booting disk showing in Linux VMware
Hi All,

This is my first question here and I am almost new to Linux. The background of my problem is...

I downloaded the Hadoop virtual machine(vmware) from Cloudera and there were some softwares that I wanted to install in that. However it(cloudera-demo-vm.vmdk) had the size of 4 GB only. Then I clicked on the hard disk portion of that virtual machine and it asked to clone a new virtual machine within same. So I did that and then the option to extend the disk was enabled in for the new vm(cloudera-demo-vm2.vmdk). I extended it to 10GB and it created the partition. I formatted and extended new partition(sdB, sdA was still showing 4GB) in Konquer utility.

But when I started my vm it still shows the same thing. when I give command "cat /proc/partitions" it shows me that there are sda, sda1, sda2 and had, hda1,hda2 partitions. Out of these one set is 4GB and another one is the extended on of 10 GB. When I see in "fstab" file it just shows 2 Label of ext3 and ext4 type. In which one of the label is same from which my linux vm starts.

Now if I go to Konquer disk partitioner utility it still shows two partitions sdA(4 GB) and sdB(10 GB).

My "fdisk" command doesn't return anything.

So I think if I can start the vm from extended partition it should work but how can I change that? If my understanding is not right then can anybody explain me what is happening here?

Thanks in advance guys !!

unSpawn 08-23-2012 07:39 AM

When working with VMware clients you should not use external tools like this "Konquer utility" unless you run it from within the virtualization client or when you've booted the client with say a Live CD or rescue disk. The simplest way to add a new disk to a client would be to add one from the VMware client configuration menu, boot the client letting it detect the secondary disk, then partition it using fdisk and create a file system and then add the corresponding partition entries in the clients /etc/fstab.

jefro 08-23-2012 10:40 AM

I have read this 5 times and I think I get the issue now.

You extended a virtual hard drive using the vm's tools. That allowed you to have more space on the original clients apparent size of drive. You should have some virtual hard drive now that has two partitions.

To change how the virtual machine boots, you'd need to fix the clients boot scheme. Example would be grub or lilo or other boot loader that tells the virtual computer to boot to a partition and load an OS.

What you wanted to do is simply copy and rename the vmdk and then fix the virtual machine construction so that it now has two virtual hard drives. Then you can either use the clients bios to select the drive you wish or change order in virtual machine construction.

I know you may not get all of that so ask away. I may not have understood the question either.

amit.agrawal21 08-24-2012 11:35 AM

3 Attachment(s)
Thanks for looking into it. I will try to explain in more detail.

I downloaded the vm (cloudera-demo-vm.vmdk) from cloudera. It was showing disk space of 4.7 GB when I fired "df -h". I will attach the screenshot of the vm settings which captured. When I clicked on the Hard disk section it is showing like this. Now if you see here the disk is showing the size 0 GB and the name is "virtual disk.vmdk" which is different than the one that I downloaded. So I was not sure what to do with it. Then I created another disk called cloudera-demo-vm2.vmdk" within the vm as is shown in 2nd & 3rd screenshot. and then I got the size 4.7 GB showing in the vm and from there I could extend it to 10 GB. It did some operation and it was extended to 10 GB.

Then I started my vm with Konquer Live CD. I saw two disks. One for 4.7 GB and another for 10 GB. I formatted the remaining space in 10 GB one.

Now I booted my vm and saw the "df -h" I still see the old config. Now I think you might be able to relate to what I wrote earlier. Please let me know if you want me to run any command and send the output for you guys to figure out. But I really appreciate your help.


jefro 08-24-2012 03:36 PM

Here is the deal. Let's start all over.

Take the vm and add a new drive the size you wish. So now you would be able to boot to the vm still and have a full 10G drive free. From here you could clone the drive to the free one. One thing you'd have to watchout for is how grub might name the drive. If it is "drive by id" UUID or drive by name then it needs to be changed to a generic like boot hd0 or such. Then just remove the original drive and leave the expanded drive to use as you wish.

I don't get those images so TobySGD may be correct that you are using VM tools and not using linux client to work on. Sorry to sound so vague.

You could have booted to the live cd image and used it to clone drive to drive and just try it that way. Use dd command and since it is a virtual machine you should be pretty safe. I mean dd within the vm, not host OS. Then switch drives/remove the original and boot to the new drive.

All times are GMT -5. The time now is 10:02 AM.