-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not able to resize a root volume on CentOS 7 (stop depending on sfdisk) #6
Comments
What's |
there is rootfs there indeed:
|
Okay, fix seems straightforward: ignore lines where rootfs is in that first field. Want to send a PR or want me to? |
I think, I can send a PR in several days. |
I made a hack to ignore rootfs and tested it. next I get: # sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 2048, size=536868864, Id=83, bootable
/dev/sda2 : start= 0, size= 0, Id= 0
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0 This a disk, partitioned by Azure. I believe, it uses MBR: # udevadm info -q property -n sda
DEVLINKS=/dev/disk/azure/root /dev/disk/by-id/scsi-3600224805ea20c1a2c0b9fc09f967f2f /dev/disk/by-id/wwn-0x600224805ea20c1a2c0b9fc09f967f2f /dev/disk/by-path/acpi-VMBUS:01-scsi-0:0:0:0
DEVNAME=/dev/sda
DEVPATH=/devices/LNXSYSTM:00/device:00/PNP0A03:00/device:08/VMBUS:01/00000000-0000-8899-0000-000000000000/host2/target2:0:0/2:0:0:0/block/sda
DEVTYPE=disk
ID_BUS=scsi
ID_MODEL=Virtual_Disk
ID_MODEL_ENC=Virtual\x20Disk\x20\x20\x20\x20
ID_PART_TABLE_TYPE=dos
ID_PATH=acpi-VMBUS:01-scsi-0:0:0:0
ID_PATH_TAG=acpi-VMBUS_01-scsi-0_0_0_0
ID_REVISION=1.0
ID_SCSI=1
ID_SERIAL=3600224805ea20c1a2c0b9fc09f967f2f
ID_SERIAL_SHORT=600224805ea20c1a2c0b9fc09f967f2f
ID_TYPE=disk
ID_VENDOR=Msft
ID_VENDOR_ENC=Msft\x20\x20\x20\x20
ID_WWN=0x600224805ea20c1a
ID_WWN_VENDOR_EXTENSION=0x2c0b9fc09f967f2f
ID_WWN_WITH_EXTENSION=0x600224805ea20c1a2c0b9fc09f967f2f
MAJOR=8
MINOR=0
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=32748
fabric_name=root what's the proper way to work around it? |
@chillum, interesting, it appears that your version of sfdisk doesn't spit out a "label: dos" or "label: gpt" line. What version do you have? I have:
I suppose I can detect the partition type by hand rather than asking sfdisk. |
I just pushed a fix, but I didn't test it. But it shouldn't be worse than today. Could you verify it works now, or reopen this with details of how it now fails? |
I have |
error message now changed: |
(and that's strange as |
Can you tell me the high-level steps for how to reproduce your environment on Azure and how to resize a disk on Azure? |
you should be able to reproduce this on Azure like this:
I actually omitted the steps for resizing the disk, as this problem is there just out of the box. To re-size the disk:
if there's something else I can help with, let me know. thanks |
Thanks! (unrelated side note: Azure doesn't let you resize a disk live? That's what embiggen-disk was really designed for, even though embiggen-disk is useful the reboot way) |
does not. to resize an Azure disk, you must have the VM powered off and deallocated. |
it may however support live-resizing of non-system disks, frankly, don't know it. |
Okay, I have an Azure instance up and I can reproduce. |
So what's happening is that embiggen-disk had assumed that the partition being resized must be the final one. What this CentOS-on-Azure instance reports is:
It has 4 partitions but only 2 are non-empty. I'll make it ignore any trailing 0-sized partitions of Id=0. |
yeah, I see the same on my instances. the second partition is empty as well on some instances (they don't use a managed disk or I don't know). like: sudo sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 2048, size= 62912512, Id=83, bootable
/dev/sda2 : start= 0, size= 0, Id= 0
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0 |
And next I hit problems with the old version of sfdisk not supporting --no-tell-kernel.
I was wary of using sfdisk and my fears were founded. I'll switch to just doing this all in Go (https://godoc.org/github.com/deitch/diskfs and https://godoc.org/github.com/deitch/diskfs/partition/mbr etc look good) and then stop using sfdisk. But I can't get to this immediately. If you want to work on this I'm happy to review. |
okay, modified the title to reflect that this is probably an Azure-specific issue (or at least personally I don't know if it's Azure-specific). will try to do a PR in some time, thanks. |
There are two issues here: Azure creating trailing zero partitions, and sfdisk being old on CentOS. I just pushed 75cd5ed for the Azure thing, so now this bug is about sfdisk problems (that we should stop depending on sfdisk, really). I'll re-title. |
The text was updated successfully, but these errors were encountered: