-1

I am running Ubuntu's latest LTS. In /dev/sda I have sda1 and sda2, both are using a couple hundreds of MiB with a couple of GiB allocated. So far so good.

In /dev/sdb I have just one partition, sdb1 - using over 300 GiB, about 98% of the available space.

I have about 350 GiB of unallocated space in /dev/sda - what is the easiest way to both move it from sda to sdb and allocate it?

GalB1t
  • 101
  • 4
  • What kind of hardware are you using? Typically /dev/sda and /dev/sdb are names for physical hard drives, so you can not move space from one to the other. But maybe you want to move content from /dev/sdb to a new partition /dev/sda3? – BeerSerc Mar 10 '16 at 14:09
  • VM over esxi. Moving the partition to to sda will solve it temporairly but most of my unallocated space is in sdb. – GalB1t Mar 10 '16 at 14:11
  • now I am confused, in the original question you stated that you have unallocated space in /dev/sda, now in the comment it's /dev/sdb. Anyway. You cannot move empty disk space from one disk to the other on the client system. Linux thinks sda and sdb are physical hard drives, so this cannot work. If you have access to the esxi host, you can try to shrink the virtual disk which your client sees as sda and then grow the virtual disk which the client sees as sdb. – BeerSerc Mar 10 '16 at 14:22
  • according to vmwares specs, https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002019, shrinking virtual disks is not possible. you can create a new smaller one, copy the data and remove the too large one though. – BeerSerc Mar 10 '16 at 14:25
  • OK, thanks! I was confused indeed in my reply, It is indeed in sda as my original post stated. – GalB1t Mar 10 '16 at 14:34

1 Answers1

0

If you use LVM on sdb1, you can also try to reduce the last partition of sda2 (after a filesystem shrink), add a sda3, pvcreate sda3, and do a vgextend + lvextend + resizefs of your filesystem which is on sdb1

mick
  • 735
  • 6
  • 7