OMV in VM - how to resize data disk?

    • OMV 4.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • OMV in VM - how to resize data disk?

      Hi

      I have OVM in VM, two virtual disks, 20gb for system, 50gb for user's data ext4. I runned out of space on data disk. I've expanded vdisk from 50 to 100GB in hypervizor and resized data partition offline using gparted live (because any resize option was not available in omv - grayed out) I've started OMV - a mess come in. The expanded disk is now added as separate ~100GB disk, and system alerts about missing 50GB data disk. Fortunately is was only a lab because I'm planning to implement OVM in production and doing some simple manual test.

      My question is how to resize virtual disk that already have a data, shares ect. ? From my perspective it should be simple - I expand the vdisk in hypervizor, then I expand the partition to maximum space available on disk. Or there is a simple way to accomplish this simple task? If now - what? Add another bigger disk and manually copy data over two disks??



      [IMG:https://i.ibb.co/y4SFChh/aaaaaaaaaaaaaaa.png]
    • One possibility is that the UUID/PUUID for the partition/disk changed when you resized. Worth checking.

      If that is case, as far as OMV is concerned you removed a HDD and replaced it with a completely different HDD with a different size.

      Work around is either to edit OMV configuration files and change UUID there or to remove the data HDD from the OMV GUI before you resize and add again, with the new UUID, after.
      OMV 4, 5 x ODROID HC2, 2 x 12TB, 2 x 8 TB, 1 x 500 GB SSD, GbE, WiFi mesh
    • New

      When I did this sort of thing on bare metal, I used "parted" to "resizepart" and I'm pretty sure that the UUID was retained by the resized partition. Try that instead of gparted and see what you get.

      Also, since you're using VMs, maybe copy the VM before trying this out, so if it makes a hash of things, you can delete the hashed job and try again.
    • New

      Right, so delete the VM where you made a hash of it and use the copy from before you made the to expanded the disk from 50GB to 100GB.

      login as root or sudo to root. You haven't said which drive name is your second drive, so I'm going to call it "/dev/b88b" but you'll need to change that to whichever drive is your 50GB drive. To figure that out, you can use "lsblk"


      Source Code

      1. # parted --align=opt /dev/b88b
      2. GNU Parted 3.2
      3. Using /dev/b88b
      4. Welcome to GNU Parted! Type 'help' to view a list of commands.
      5. (parted) m
      6. align-check TYPE N check partition N for TYPE(min|opt) alignment
      7. help [COMMAND] print general help, or help on COMMAND
      8. mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
      9. mkpart PART-TYPE [FS-TYPE] START END make a partition
      10. name NUMBER NAME name partition NUMBER as NAME
      11. print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a
      12. particular partition
      13. quit exit program
      14. rescue START END rescue a lost partition near START and END
      15. resizepart NUMBER END resize partition NUMBER
      16. rm NUMBER delete partition NUMBER
      17. select DEVICE choose the device to edit
      18. disk_set FLAG STATE change the FLAG on selected device
      19. disk_toggle [FLAG] toggle the state of FLAG on selected device
      20. set NUMBER FLAG STATE change the FLAG on partition NUMBER
      21. toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
      22. unit UNIT set the default unit to UNIT
      23. version display the version number and copyright information of GNU Parted
      24. (parted) resizepart
      Display All
      And you can follow along with the rest of the "(5) resize a partition" at Tecmint.
    • New

      Right, so delete the VM where you made a hash of it and use the copy from before you made the decision to expanded the disk from 50GB to 100GB.

      login as root or sudo to root. You haven't said which drive name is your second drive, so I'm going to call it "/dev/b88b" but you'll need to change that to whichever drive is your 50GB drive. To figure that out, you can use "lsblk"
      next, unmount the drive

      Source Code

      1. # umount /dev/b88b


      If that doesn't work it's because the drive is in use. I have no idea what you're using the drive for or how, so I'm not even going to try to enumerate the zillions of ways that might need to be done. Start with making sure it's not used by any of the services or docker and then remove it from the shared folders list. Beyond that you're on your own.

      Source Code

      1. # parted --align=opt /dev/b88b
      2. GNU Parted 3.2
      3. Using /dev/b88b
      4. Welcome to GNU Parted! Type 'help' to view a list of commands.
      5. (parted) m
      6. align-check TYPE N check partition N for TYPE(min|opt) alignment
      7. help [COMMAND] print general help, or help on COMMAND
      8. mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
      9. mkpart PART-TYPE [FS-TYPE] START END make a partition
      10. name NUMBER NAME name partition NUMBER as NAME
      11. print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a
      12. particular partition
      13. quit exit program
      14. rescue START END rescue a lost partition near START and END
      15. resizepart NUMBER END resize partition NUMBER
      16. rm NUMBER delete partition NUMBER
      17. select DEVICE choose the device to edit
      18. disk_set FLAG STATE change the FLAG on selected device
      19. disk_toggle [FLAG] toggle the state of FLAG on selected device
      20. set NUMBER FLAG STATE change the FLAG on partition NUMBER
      21. toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
      22. unit UNIT set the default unit to UNIT
      23. version display the version number and copyright information of GNU Parted
      24. (parted) resizepart
      Display All
      And you can follow along with the rest of the "(5) resize a partition" at Tecmint.

      After you've resized the disk, I assume you'll want to resize the file system to the full extent of the drive partition.

      Source Code

      1. # e2fsck -f /dev/b88b1
      2. # resize2fs /dev/b88b1
      3. # e2fsck -f /dev/b88b1
    • New

      should the resize operation be done offline? start some live cd? if not what to do in OMV before extending the disk?
      about the disks in my setup:

      /dev/sda - for omv
      /dev/sdb - for data - and I want to extend this disk.

      I have intermediate linux knowledge ;) but I'm totally new to OMV
    • New

      I've exnanded vdisk in virtualbox, then boot of linux mint and ran resize2fs:

      can this operation be done without any errors? I'm the only one who wants to resize data disk in ovm running in virtual machine?



      ---
      On omv box I've stopped all sevices expect ssh to perrform resize2fs:

      /dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
      /dev/sdb1 on /srv/dev-disk-by-label-50giga type ext4 (rw,noexec,relatime,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group) [50giga]
      /dev/sdb1 on /sharedfolders/instalki type ext4 (rw,noexec,relatime,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group) [50giga]

      root@omv01:~# resize2fs /dev/sdb1
      resize2fs 1.44.4 (18-Aug-2018)
      The filesystem is already 13106939 (4k) blocks long. Nothing to do!

      I'm using ext as sdb disk - according support.citrix.com/article/CTX…rix.com/article/CTX125405


      #umount /dev/xvdc1
      #fdisk /dev/xvdc1
      #d (Delete the partition and recreate it)
      #n (New partition)
      #w (Write out table)
      #e2fsck -f /dev/xvdc1
      #resize2fs /dev/xvdc1
      #mount /dev/xvdc1 /home

      That should do, but there is abovementioned error:

      root@omv01:~# resize2fs /dev/sdb1
      resize2fs 1.44.4 (18-Aug-2018)
      The filesystem is already 13106939 (4k) blocks long. Nothing to do!

      ---
      2nd try directly on omv:
      root@omv01:~# resize2fs /dev/sdb1
      resize2fs 1.44.4 (18-Aug-2018)
      Please run 'e2fsck -f /dev/sdb1' first.

      root@omv01:~# e2fsck -f /dev/sdb1
      e2fsck 1.44.4 (18-Aug-2018)
      Pass 1: Checking inodes, blocks, and sizes
      Pass 2: Checking directory structure
      Pass 3: Checking directory connectivity
      Pass 4: Checking reference counts
      Pass 5: Checking group summary information
      50giga: 31/3276800 files (3.2% non-contiguous), 447144/13106939 blocks
      root@omv01:~# resize2fs /dev/sdb1
      resize2fs 1.44.4 (18-Aug-2018)
      The filesystem is already 13106939 (4k) blocks long. Nothing to do!

      ---
      IDK - maybe it's some virtualbox quirk? Can anyone make simple vlab with omv - two disk, 20 system, 50gb data, then expand second disk to 100gb, and then try to expand disk so OMV could use whole 100gb space?


      ----

      The post was edited 6 times, last by akurzawa ().

    • New

      akurzawa wrote:

      I've exnanded vdisk in virtualbox, then boot of linux mint and ran resize2fs:
      #fdisk /dev/xvdc1

      #d (Delete the partition and recreate it)
      #n (New partition)
      #w (Write out table)
      #e2fsck -f /dev/xvdc1
      if you follow the parted instructions I provided, you would not lose the UUID for the partition when you delete it in fdisk. Sorry if I didn't make it clear why you shouldn't use fdisk for this task.

      # umount /dev/xvdc1
      # e2fsck -f /dev/xvdc1 << the current version in OMV4 is 1.44.4 (18-Aug-2018). Your mint version is from 2015.
      # df /dev/xvdc1
      # fdisk -l /dev/xvdc
      << verify that df reports the xvdc1 size as 50GB and fdisk reports the 100GB size - noting that df reports 1024b blocks and fdisk reports 512b sectors>>
      # resize2fs /dev/xvdc1
      # df /dev/xdc1

      This is pretty reliable.

      The gui can be unreliable if you're doing things at the command line. You'll have cached data on your browser and the nginx engine may potentiall cache some data as well.

      I'm not familiar with mint. I use knoppix for a boot OS and it's been completely reliable for me.
    • New

      My mint was downloaded three days ago - maybe the iso have old version of software. No no I didnt used fdisk for resize - I know fdisk dont work with gpt disks. I've used parted and also tried resize2fs exacly how I showed here:


      2nd try directly on omv:
      root@omv01:~# resize2fs /dev/sdb1
      resize2fs 1.44.4 (18-Aug-2018)
      Please run 'e2fsck -f /dev/sdb1' first.

      root@omv01:~# e2fsck -f /dev/sdb1
      e2fsck 1.44.4 (18-Aug-2018)
      Pass 1: Checking inodes, blocks, and sizes
      Pass 2: Checking directory structure
      Pass 3: Checking directory connectivity
      Pass 4: Checking reference counts
      Pass 5: Checking group summary information
      50giga: 31/3276800 files (3.2% non-contiguous), 447144/13106939 blocks
      root@omv01:~# resize2fs /dev/sdb1
      resize2fs 1.44.4 (18-Aug-2018)
      The filesystem is already 13106939 (4k) blocks long. Nothing to do!


      The mint I've used is lmde - its clear debian + some gui stuff
    • New

      I've just loggen in :)

      this is the data:

      Source Code

      1. Last login: Wed Dec 5 13:22:15 2018 from 10.0.0.174
      2. root@omv01:~# df -h
      3. Filesystem Size Used Avail Use% Mounted on
      4. udev 982M 0 982M 0% /dev
      5. tmpfs 200M 3.2M 197M 2% /run
      6. /dev/sda1 18G 1.6G 16G 10% /
      7. tmpfs 999M 0 999M 0% /dev/shm
      8. tmpfs 5.0M 0 5.0M 0% /run/lock
      9. tmpfs 999M 0 999M 0% /sys/fs/cgroup
      10. tmpfs 999M 0 999M 0% /tmp
      11. /dev/sdb1 49G 688M 49G 2% /srv/dev-disk-by-label-50giga
      12. root@omv01:~#
      Display All


      Source Code

      1. root@omv01:~# fdisk -l
      2. Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
      3. Units: sectors of 1 * 512 = 512 bytes
      4. Sector size (logical/physical): 512 bytes / 512 bytes
      5. I/O size (minimum/optimal): 512 bytes / 512 bytes
      6. Disklabel type: dos
      7. Disk identifier: 0x257613c5
      8. Device Boot Start End Sectors Size Id Type
      9. /dev/sda1 * 2048 37748735 37746688 18G 83 Linux
      10. /dev/sda2 37750782 41940991 4190210 2G 5 Extended
      11. /dev/sda5 37750784 41940991 4190208 2G 82 Linux swap / Solaris
      12. GPT PMBR size mismatch (104857599 != 209715199) will be corrected by w(rite).
      13. Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors
      14. Units: sectors of 1 * 512 = 512 bytes
      15. Sector size (logical/physical): 512 bytes / 512 bytes
      16. I/O size (minimum/optimal): 512 bytes / 512 bytes
      17. Disklabel type: gpt
      18. Disk identifier: 39D43581-36CA-42A2-B921-3BCE200E8619
      19. Device Start End Sectors Size Type
      20. /dev/sdb1 2048 104857566 104855519 50G Linux filesystem
      21. root@omv01:~#
      Display All

      Post by akurzawa ().

      This post was deleted by ryecoaaron ().