Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Partitioning /root in a VM

  1. #11
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,293
    Blog Entries
    2

    Default Re: Partitioning /root in a VM

    Hope I'm not stating some obvious things...

    - If you value the contents of your diskfile, <never> perform major surgery on an only copy. Always copy the disk before applying disk operations against one of the copies.
    - Keep in mind my Post #4

    It's been a long time since I've attempted to modify partitions in a diskfile like what you seem to be doing with libvirt.
    Your LVM issue may be related to some other LVM related posts I've seen in the Install/Boot forum... something about LVM installed and running even when not used(may be also totally unrelated). But, since I haven't personally run into that yet, I haven't dived into whatever that situation involved.

    TSU

  2. #12

    Default Re: Partitioning /root in a VM

    @pbiel

    There seems to be a bug in the current package in the repositories.
    Libguestfs spits out those errors when it can't find some files that are
    missing from the initramfs:
    https://bugzilla.novell.com/show_bug.cgi?id=908632

    The bug appears to be fixed, however just a short while ago there was
    a new request submitted with regards to fixing this bug:
    https://build.opensuse.org/request/show/308082
    "- Package guestfs_lvm_conf.aug (bnc#908632)"

    You could try to install the latest version of package "guestfs-data" according to
    post #4 in the bug report above:
    Code:
    # zypper -p http://download.opensuse.org/repositories/Virtualization/openSUSE_13.2/ in guestfs-data-1.26.10-168.11.x86_64
    (assuming you're using 64-bit, else you should pick the 32-bit package)

    Then repeat the last step that failed.

  3. #13

    Default Re: Partitioning /root in a VM

    Just a small adjustment to my previous post:
    Code:
    # zypper -p http://download.opensuse.org/repositories/Virtualization/openSUSE_13.2/ in guestfs-data
    should be enough. Zypper should pick the correct architecture.

  4. #14
    Join Date
    Jun 2014
    Location
    Bonn, Germany
    Posts
    67

    Default Re: Partitioning /root in a VM

    Hi, and thanks so far!


    @DanneStrat: Thanks, this solved the one issue. Now, virt-resize walk through like a charm:

    Code:
    Summary of changes:
    
    /dev/sda1: This partition will be left alone.
        
        /dev/sda2: This partition will be resized from 10,0G to 15,0G.  The 
        filesystem btrfs on /dev/sda2 will be expanded using the 
        'btrfs-filesystem-resize' method.
        
        /dev/sda3: This partition will be left alone.
        
        **********
    Setting up initial partition table on ~/.local/share/gnome-boxes/images/outdisk ...
    Copying /dev/sda1 ...
     100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
    Copying /dev/sda2 ...
     100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
    Copying /dev/sda3 ...
     100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
    Expanding /dev/sda2 using the 'btrfs-filesystem-resize' method ...
    
    Resize operation completed with no errors.  Before deleting the old 
    disk, carefully check that the resized disk boots and works correctly.
    Unfortunately, the virtual machine, after reboot, seems to be not impressed:

    Code:
    btrfs fi df -h /
    Data, single: total=8.19GiB, used=8.17GiB
    System, DUP: total=32.00MiB, used=16.00KiB
    Metadata, DUP: total=896.00MiB, used=574.89MiB
    GlobalReserve, single: total=192.00MiB, used=3.66MiB
    Am I doing something wrong here?
    Do I probably need to point the vm to the new disk? I mean, the old one still exists and the new (= large) might ignored… Should I do something such as
    Code:
    mv ~/.local/share/gnome-boxes/images/outdisk ~/.local/share/gnome-boxes/images/boxes-unknown
    ?
    I'm not sure whether that's a good idea… (sorry, newbie)

    Thanks in advance

  5. #15

    Default Re: Partitioning /root in a VM

    Yes, now you need to change the disk to the new one.
    If you have enough disk space I would advise you to
    first make a backup of the old disk before you overwrite it:
    Code:
    $ cp ~/.local/share/gnome-boxes/images/boxes-unknown ~/.local/share/gnome-boxes/images/boxes-unknown.old
    Power off the virtual machine if you haven't done so already and move to the new disk:
    Code:
    $ mv ~/.local/share/gnome-boxes/images/outdisk ~/.local/share/gnome-boxes/images/boxes-unknown
    then boot the virtual machine and try it out. If something has failed you can just go back to the old one and try again:
    Code:
    $ mv ~/.local/share/gnome-boxes/images/boxes-unknown.old ~/.local/share/gnome-boxes/images/boxes-unknown
    If everything works, then you can delete the backup:
    Code:
    $ rm ~/.local/share/gnome-boxes/images/boxes-unknown.old

  6. #16

    Default Re: Partitioning /root in a VM

    If the VM fails to start after doing:
    Code:
    $ mv ~/.local/share/gnome-boxes/images/outdisk ~/.local/share/gnome-boxes/images/boxes-unknown
    then there is a possibility the new disk type is "raw" while the old one was "qcow2" (the default format used by qemu).
    To find out if this is the case do:
    Code:
    $ virsh dumpxml ~/.local/share/gnome-boxes/images/boxes-unknown | xpath /domain/devices
    and look for something like:
    <devices>
    <disk type='file' device='disk'>
    <driver name="qemu" type="qcow2"

    If it says type="qcow2" then convert the disk to "qcow2":
    Code:
    # zypper in qemu-tools
    Code:
    $ qemu-img convert -O qcow2 ~/.local/share/gnome-boxes/images/boxes-unknown ~/.local/share/gnome-boxes/images/boxes-unknown.qcow2
    Code:
    $ mv ~/.local/share/gnome-boxes/images/boxes-unknown.qcow2 ~/.local/share/gnome-boxes/images/boxes-unknown
    then boot the VM.

  7. #17
    Join Date
    Jun 2014
    Location
    Bonn, Germany
    Posts
    67

    Default Re: Partitioning /root in a VM

    Hi,

    thanks so far… It's still not over

    Code:
    Boxes-WARNING **: machine.vala:576: Failed to start oS Tumbleweed: Unable to start domain: internal error: process exited while connecting to monitor: 2015-05-21T23:39:19.479393Z qemu-system-x86_64: -drive file=/home/philipp/.local/share/gnome-boxes/images/boxes-unknown,if=none,id=drive-ide0-0-0,format=qcow2,cache=none: could not open disk image /home/philipp/.local/share/gnome-boxes/images/boxes-unknown: Image is not in qcow2 format
    Any idea? I mean, I did not change the format of anything *willingly*. ****.

  8. #18
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,293
    Blog Entries
    2

    Default Re: Partitioning /root in a VM

    Just a FYI and not intended to discourage your efforts...
    I myself ran into this issue (needing to enlarge / ) on one of my VMs today, so this is what I did... The approach and utilities I used should work using any virtualization technology and even any disk format.

    As I described earlier, sometimes you also need to enlarge the disk. Even if you might originally want to simply re-size some other partition to make room for enlarging the root partition, IMO it's simpler and likely a better long term decision to just enlarge the disk so that you're not making another partition smaller(possibly causing another future problem). In this case, I decided to simply create a new, larger disk and then to clone the old disk to the new.

    I decided to use Clonezilla to do the whole disk cloning, and if necessary to use gpart-live to modify the individual partitions. Other options should also be good like using dd to block copy/clone, or using other utilities.

    1. Create a new disk with the desired new size. Leave it attached to the vm, I found that Clonezilla requires this to "see" both disks.
    2. Configure the Guest to boot to Clonezilla
    2a. Select the "Advanced" instead of default options. Select disk to disk cloning and no NTFS options, everything else default, including options to write boot to the new disk.
    2b. Select and verify sda as the source (which likely will always be the case, but doublecheck by observing the disk sizes).
    3. Shutdown
    4. Disable CDROM or otherwise force boot to disk
    5. Remove the original virtual disk, leaving only the new disk.
    6. Boot to your new disk.
    7. Inspect and verify all is running correctly. You can use "df" to view your partitions and partition usage.
    8. Shutdown.
    9. Configure gparted-live in the Guest CDROM
    10. Boot to gparted-live, like myself despite authorizing Clonezilla to auto expand to fill the disk, it didn't happen and you'll find unformatted/unpartitioned disk space
    11. Re-size / to fill the empty space
    12 Shutdown
    13. Boot to your system and verify the success of your operations by running "df" again.

    HTH,
    TSU

  9. #19

    Default Re: Partitioning /root in a VM

    Quote Originally Posted by pbiel View Post
    Hi,

    thanks so far… It's still not over

    Code:
    Boxes-WARNING **: machine.vala:576: Failed to start oS Tumbleweed: Unable to start domain: internal error: process exited while connecting to monitor: 2015-05-21T23:39:19.479393Z qemu-system-x86_64: -drive file=/home/philipp/.local/share/gnome-boxes/images/boxes-unknown,if=none,id=drive-ide0-0-0,format=qcow2,cache=none: could not open disk image /home/philipp/.local/share/gnome-boxes/images/boxes-unknown: Image is not in qcow2 format
    Any idea? I mean, I did not change the format of anything *willingly*. ****.
    It complains about the image not being in "qcow2" format (see the highlighted text in the error message I quoted).
    Try to convert the disk to "qcow2" as I described in my previous post.

  10. #20
    Join Date
    Jun 2014
    Location
    Bonn, Germany
    Posts
    67

    Default Re: Partitioning /root in a VM

    Yep, I totally missed that, thank you.

    It worked really well and now it's absolutely fine. Thanks all of you for your helpfulness. Special thanks to @DanneStrat for his patience!

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •