Webconverger / webc

Webconverger's curated chroot from which updates originate
https://webconverger.org/upgrade/
73 stars 37 forks source link

Persistent USB version that takes entire size of USB key #133

Closed kaihendry closed 11 years ago

kaihendry commented 11 years ago

http://ix.io/44S

Currently IIUC if we make build-hdd and image that to a disk, we occupy about ~315M of fat16 space. We need to do what RasberryPI does and expand_rootfs.

Wondering is it worth switching to ext4? Surely a bit faster?

kaihendry commented 11 years ago

IIUC https://github.com/asb/raspi-config/blob/master/raspi-config#L17 just creates a new partition in /dev/mmcblk0p2.

matthijskooijman commented 11 years ago

It actually deletes the old partition first:

p # Print partition table d # Delete 2 # partition 2 n # Create new p # primary partion 2 # with number 2 $PART_START # Starting at $PART_START

Ending at the last sector (default choice)

p # Print again w # Write changes EOF

matthijskooijman commented 11 years ago

And then it resizes the filesystem at the next boot, using a one-off initscript (but I'd create a normal initscript that checks the existence of a /resize_rootfs file instead of creating and deleting the actual initscript). Additionally, it might not even be needed to wait for a reboot, if the kernel can properly re-read the partition table (but that doesn't always work, not sure under which conditions).

Finally, it might be useful to do the (filesystem) resize in initrd, so it can be an offline resize instead of online, which might be a bit more reliable and works for more filesystems.

kaihendry commented 11 years ago

Assuming you reboot after re-creating the primary partition and run resize2fs, you surely need a ext based filesystem instead of the fat16 the .img creates?

I tried --binary-filesystem ext4 with REAL_DIM=400, and I get an error:

 syslinux: invalid media signature (not an FAT/NTFS volume?)

So I am stuck on how to do this using live-build.

I'm thinking now I need to focus on the installer, and the case whereby I have two usb sticks A&B

  1. dd Webconverger onto A as usual http://webconverger.org/usb/
  2. Boot A with B also in the slot
  3. Choose to install to B (from A)
  4. Use dialog to choose to install onto B as a disk drive
matthijskooijman commented 11 years ago

I think ext needs extlinux, not syslinux (but AFAIK live-build should autoselect this, bug in live-build?)

Alternatively, you could try using fatresize (which exists according to Google) instead of resize2fs.

Enabling the install-drive choice using dialog is also a good idea (but that required a newer plymouth, the old version didn't reset the terminal properly or something). Didn't we get a newer plymouth from baureo for free?

kaihendry commented 11 years ago

I actually removed Plymouth (for the interim) in the baureo build. So I just need to give it a whirl.

On Thursday, January 24, 2013, Matthijs Kooijman wrote:

I think ext needs extlinux, not syslinux (but AFAIK live-build should autoselect this, bug in live-build?)

Alternatively, you could try using fatresize (which exists according to Google) instead of resize2fs.

Enabling the install-drive choice using dialog is also a good idea (but that required a newer plymouth, the old version didn't reset the terminal properly or something). Didn't we get a newer plymouth from baureo for free?

— Reply to this email directly or view it on GitHubhttps://github.com/Webconverger/webc/issues/133#issuecomment-12644159.

kaihendry commented 11 years ago

This is working in the systemd branch. :)