0

I am currently trying to use the YaST partitioner tool (on openSUSE 13.2 under VirtualBox) to move the Linux swap partition on a VirtualBox virtual disk image. Upon trying to move any given partition on the virtual disk, I get the error "The partition /dev/sdb< x > is already created on disk and cannot be moved." In addition, I cannot seem to resize any partition beyond its already existing size despite the fact that I have 40.82 GB of unpartitioned space on the virtual disk.

I have read that this supposedly can be caused by having the disk mounted, but, as far as I can tell, the disk is not mounted (none of the partitions under sdb have a Mount Point, and mount does not show any of the partitions on this virtual disk).

Have I made a mistake, and, if not, is there a way to resolve this issue?

Edit: The following is a screenshot of where I am in the YaST partitioner tool:

enter image description here

  • Is the virtual disk fully mapped out, or is it set to grow the disk as more space is needed? – brianlmerritt Jan 30 '16 at 7:43
  • @brianlmerritt The virtual disk is a dynamically allocated virtual hard disk (the latter). I can try cloning the hard disk to a fixed sized virtual disk and using that to see if it will help. – fakedad Jan 30 '16 at 23:26
  • Not guaranteed, but just a thought that a virtual virtual partition may be an issue – brianlmerritt Jan 31 '16 at 12:57
  • @brianlmerritt Unfortunately, it seems that using a fixed-size clone of the disk makes no difference; I get the same errors/problems. – fakedad Feb 4 '16 at 2:31
  • Maybe edit your question and screen snapshot your Yast partitions ? Also please note: forums.opensuse.org/showthread.php/… – brianlmerritt Feb 4 '16 at 7:14
0
+50

YaST doesn't allow partitions already on disk to be moved—the feature is only there for moving partitions you've added prior to writing them to disk. This can be a problem if it's a data partition as deleting and recreating it would result in data loss, but since this is a swap partition, no data would be lost on doing so.

What you'll need to do is delete the extended partition sdb2, which will also delete sdb5. From there, you can recreate the swap partition at the end of the disk, which will allow you to expand the data partition sdb1 as needed. I'd recommend that you don't create an extended partition unless you expect to need more than four partitions on the disk. (If you do need more than four partitions, you should probably be using GPT instead.)

  • The suggested procedure works, but I do not understand the explanation. fdisk -l shows that the sdb2 partition starts at 100665342 and ends at 104855551. Wouldn't the end be much greater if the extended partition includes all of the space that YaST lists as "Unpartitioned"? – fakedad Mar 5 '16 at 7:53
  • Also, why is it that the YaST cannot move partitions already existing on the disk? I remember a few tutorials (such as this one suggested that the swap partition be moved in order to enable resizing of the main partition, but all of these tutorials involved using GParted. Is the ability to move partitions like this a feature that GParted has, but YaST Expert Partitioner lacks? – fakedad Mar 5 '16 at 7:58
  • Most likely—I'm not familiar with GParted, but from what I know, it can move existing partitions, which YaST can't. I'm rather confused about the fdisk -l output, though. It might be a quirk with the way it handles extended partitions... – bwDraco Mar 5 '16 at 16:41
  • No the extended partition (sdb2) is not created till the end of the disk. You can see that as well in YaST partitioner that it ends at the same point as the swap partition (sdb5) inside it. Also, look at their sizes, both are 2.00 GiB. – Tom Yan Mar 9 '16 at 7:43
  • Can't revise at this time, but will look into it tomorrow. Logical partitions still need to be contiguous to avoid wasting space, from what I'm reading. – bwDraco Mar 9 '16 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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