sakaki- / gentoo-on-rpi-64bit

Bootable 64-bit Gentoo image for the Raspberry Pi4B, 3B & 3B+, with Linux 5.4, OpenRC, Xfce4, VC4/V3D, camera and h/w codec support, weekly-autobuild binhost
GNU General Public License v3.0
921 stars 126 forks source link

use "hdparm -z /dev/mmcblk0" instead of rebooting #42

Closed tidux closed 6 years ago

tidux commented 6 years ago

This forces a rescan of the partition table, and hdparm is known to work with mmcblk devices.

sakaki- commented 6 years ago

Some people boot the image on non-sdcard devices though (there are a number of university users who have it set up this way); that's why the root is identified by UUID and the reboot is done. It only happens on first boot anyhow.

sakaki- commented 6 years ago

Plus, and this is the more important point, afaik you cannot straightforwardly change the kernel's (active) partition table for a (non-vm, non-LVM) mounted root partition without a reboot, see e.g. here.

It is possible to avoid a reboot if you e.g. switch root to a minimal ramfs, do the resize, reload the partition table, then switch root back, but it seemed simpler (given the one-time nature of the issue) just to reboot.

If this has changed (more recent kernel etc.) I'd be interested to know.

tidux commented 6 years ago

Ah, I didn't realize it was all root. In my usage of hdparm -z for live resize of disk images it's a separate storage volume on VMs.