fix resize
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
parent
d58264fc8c
commit
0deecce2de
@ -62,17 +62,22 @@ func ResizeRootFS() error {
|
|||||||
if err = cmd.Wait(); err != nil || partition == "" {
|
if err = cmd.Wait(); err != nil || partition == "" {
|
||||||
return fmt.Errorf("failed to find partition on %s\n", device)
|
return fmt.Errorf("failed to find partition on %s\n", device)
|
||||||
}
|
}
|
||||||
log.Printf("%s %s\n", device, partition)
|
|
||||||
/*
|
commands := []string{
|
||||||
echo "sysctl kern.geom.debugflags=16" >> /etc/rc.local
|
"sysctl kern.geom.debugflags=16",
|
||||||
echo "gpart resize -i 1 da0" >> /etc/rc.local
|
"gpart resize -i 1 " + strings.Split(device, "/")[2],
|
||||||
echo "gpart resize -i 1 da0s1" >> /etc/rc.local
|
"gpart resize -i 1 " + strings.Split(device, "/")[2] + partition,
|
||||||
echo "true > /dev/da0" >> /etc/rc.local
|
"true > " + device,
|
||||||
echo "true > /dev/da0s1" >> /etc/rc.local
|
"true > " + device + partition,
|
||||||
echo "true > /dev/da0s1a" >> /etc/rc.local
|
"true > " + device + partition + "a",
|
||||||
echo "gpart resize -i 1 da0" >> /etc/rc.local
|
"gpart resize -i 1 " + strings.Split(device, "/")[2],
|
||||||
echo "gpart resize -i 1 da0s1" >> /etc/rc.local
|
"gpart resize -i 1 " + strings.Split(device, "/")[2] + partition,
|
||||||
echo "growfs -y /" >> /etc/rc.local
|
"growfs -y /",
|
||||||
*/
|
}
|
||||||
|
|
||||||
|
for _, command := range commands {
|
||||||
|
log.Printf("resize fs %s\n", command)
|
||||||
|
exec.Command(strings.Split(command, " ")[0], strings.Split(command, " ")[1:]...).Run()
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user