/srv/irclogs.ubuntu.com/2015/10/19/#cloud-init.txt

=== shardy_afk is now known as shardy
Odd_Blokesmoser: I'm looking at switching MBR disk setup to use sectors (rather than MB), because sfdisk in wily has dropped support for units other than sectors.14:10
smoseryes please.14:11
Odd_Blokesmoser: How would you suggest I test this?  I've done [33, [66, 82]], which is the canonical example we use.14:11
Odd_BlokeBut I don't really know what corner cases we might have that I should look at.14:11
smosermainly i think you dont have to care.14:11
smoserCHS is garbage.14:11
smoserthats waht you're asking about, right?14:12
smoserwhat did '33, 66, 82' mean ?14:12
Odd_Blokesmoser: No, at the moment we do (essentially) 'cat <list of partitions> | sfdisk -uM <device>'.14:13
Odd_Blokesmoser: But sfdisk no longer supports megabytes as units, so I'm switching to using sectors as the units.14:13
Odd_Blokesmoser: This is https://bugs.launchpad.net/cloud-init/+bug/146071514:13
smoserah. ok.14:14
smoserwhat did you mean 33, 66, 82 ?14:14
Odd_Blokesmoser: So I've tested using 'layout: [33, [66, 82]' (i.e. one-third ext4, two-thirds swap), but I don't really know what else to try to check that it works in practice.14:14
smoserOdd_Bloke, ok. now reading code and understand more.14:19
smoserwell you basically have to turn everything into sectors.14:20
smosernow, to deal with sfdisk14:20
Odd_Blokesmoser: Yeah, it's actually surprisingly painless.14:21
Odd_Blokesmoser: I've got a branch prepped, I'm just trying to test it before pushing it up for review.14:21
smoseri've never really used that code.14:21
smoserin the future the plan is to support the disk layout settings taht curtin can do.14:22
Odd_Blokesmoser: OK, I'll just push this up for review then.14:22
Odd_BlokeI've done some basic testing.14:22
Odd_Blokesmoser: That's https://code.launchpad.net/~daniel-thewatkins/cloud-init/lp1460715/+merge/27489714:40
smoserOdd_Bloke, it'd be good to know if this code runs on old sfdisk14:41
Odd_Blokesmoser: Ah, good point.14:42
Odd_Blokesmoser: The existing trusty code doesn't work even without my changes. /o\14:55
Odd_BlokeAh, I'm hitting https://bugs.launchpad.net/cloud-init/+bug/1311463.14:56
smoserOdd_Bloke, added a review14:59
Odd_Blokesmoser: Thanks!  Replied to the inline comment.15:06
smoseri've always been confused by sfdisk also15:07
smoserlets find the real ansewr.15:08
smoserbut i suspect it is 51215:08
Odd_Blokesmoser: I've been poking around in that code; let me have a dig before you switch to this.15:09
Odd_Bloke(As in, I've been poking in the sfdisk code)15:09
smoserreading http://karelzak.blogspot.com/2014/10/new-sfdisk.html15:10
Odd_Blokesmoser: So my code doesn't backport to trusty nicely, because old 'sfdisk -l' output is different.15:12
smoseryeah. i'm aware of such pain .15:13
smoserfrom growpart15:13
smoserit does support both. but its a pita15:13
smoserhttp://bazaar.launchpad.net/~cloud-utils-dev/cloud-utils/trunk/view/head:/bin/growpart15:14
smoserOdd_Bloke, the thing is that if we update to only supporting new, then anyone who picks this up is busted on old sfdisk15:14
smoserin growpart, SFDISK_VERSION madness.15:15
Odd_Blokesmoser: ;.;15:16
Odd_Blokesmoser: So libfdisk definitely supports variable sector sizes; I don't know if we'd ever see them in practice.15:19
smoserbut then its not clear to me if it woudl be used anyway.15:20
smoserlogical sector size versus physical sector size15:20
Odd_Blokesmoser: Right.15:22
Odd_Blokesmoser: I have a meeting coming up, but I'll pick this up after that.15:22
smoserOdd_Bloke, so.16:56
smoserthrough some experimentation, i can verify that sfdisk uses 512 byte sectors16:56
=== mfisch` is now known as mfisch
Odd_Blokesmoser: You're sure we won't hit funky hardware somewhere where it doesn't?16:59
=== mfisch is now known as Guest27947
smoseri dont think so16:59
smoserhttp://paste.ubuntu.com/12863364/16:59
=== Guest27947 is now known as mfisch
smoserOdd_Bloke, ^ that boots a guest with 4096 physical size and 512 logical (interestingly, it wont boot if you set logical to 4096).17:00
smoserverified that the kernel says my physical size is 409617:01
smoserand that size reported (in your 'sfdisk --list') is in 51217:01
smoserOdd_Bloke,  http://paste.ubuntu.com/12863544/17:12
harlowjasmoser https://github.com/openstack/cloud-init17:16
harlowjaguess now cloud-init == openstack17:16
harlowjalol17:16
harlowjaOdd_Bloke ^  claudiupopa17:17
smoseroh well. it is. as it is.17:17
harlowja:-P17:17
natoriousoh wow17:17
natoriousdid they merge the stackforge org into openstack?17:17
natoriousI suppose17:17
harlowjayup17:17
harlowjastackforge gone...17:17
harlowjaand/or retired17:18
natoriousfwiw, I report cloud-init hours worked as openstack dev hours17:18
harlowjanice17:18
harlowjawell now u can do that without feeling bad, ha17:18
natoriouslol, no bad feelings here :P17:19
Odd_Blokesmoser: So looking at the util-linux code; sector size defaults to 512, but it does do an 'ioctl(fd, BLKSSZGET, sector_size)' call to actually query the device (https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/lib/blkdev.c#n193).17:19
Odd_Blokesmoser: But that does mean that a `blockdev --getss $DEVICE` is definitely going to return the same answer, which would save on parsing sfdisk output.17:20
Odd_BlokeLet me check that makes sense on trusty.17:21
smoserok. i'm wrong17:50
smoserhttp://paste.ubuntu.com/12864078/17:50
smoseryour'e right about blockdev --getss17:51
smoserbut i think thats the same as woudl be returned by *logical*17:51
smoserhttp://paste.ubuntu.com/12864114/17:52
smoser^--17:52
smoserso reading logical in sys shoudl give you what sfdisk does.17:53
smoseri managed to create a device with 4096 logical17:53
smoserso ... sfdisk uses logical sectors. not physical sectors.17:54
=== shardy is now known as shardy_afk
=== Guest3686 is now known as mgagne

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!