diff options
| author | Christian Schlüter <chschlue@gmail.com> | 2018-07-15 00:03:02 +0200 |
|---|---|---|
| committer | Christian Schlüter <chschlue@gmail.com> | 2018-07-15 00:03:02 +0200 |
| commit | 4341e7353dc8e1b7aa0b2a4076d218c79d6d70cf (patch) | |
| tree | cff04f9e2749cce4bc4043308b36653ba781e1eb | |
| parent | d4874ba3dfc9b3bd6ab8e10300a31079ca42e89c (diff) | |
Fix resizerootfs
| -rwxr-xr-x | rpi3-resizerootfs | 14 | ||||
| -rw-r--r-- | rpi3-resizerootfs.service | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/rpi3-resizerootfs b/rpi3-resizerootfs index 32c861c..37a0b40 100755 --- a/rpi3-resizerootfs +++ b/rpi3-resizerootfs @@ -4,10 +4,20 @@ roottmp=$(lsblk -l -o MAJ:MIN,MOUNTPOINT | grep '/$') rootpart=/dev/block/${roottmp% /} rootdev=${rootpart%:*}:0 -sfdisk -f $rootdev -N 2 <<EOF +flock $rootdev sfdisk -f $rootdev -N 2 <<EOF ,+ EOF -partprobe +sleep 5 + +udevadm settle + +sleep 5 + +flock $rootdev partprobe $rootdev + +mount -o remount,rw $rootpart resize2fs $rootpart + +exit 0 diff --git a/rpi3-resizerootfs.service b/rpi3-resizerootfs.service index e90252e..131955e 100644 --- a/rpi3-resizerootfs.service +++ b/rpi3-resizerootfs.service @@ -5,6 +5,7 @@ DefaultDependencies=no [Service] Type=oneshot +TimeoutSec=600 ExecStart=/usr/sbin/rpi3-resizerootfs ExecStart=/bin/systemctl --no-reload disable %n |
