mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-18 17:01:07 +00:00
Try resizing all found devices (#4099)
* Try resizing all found devices fixes #4098 Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de> * Update package tags of pkg/extend Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de> --------- Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
This commit is contained in:
parent
fd6839d0fe
commit
66ca00915a
@ -22,8 +22,9 @@ import (
|
||||
const timeout = 60
|
||||
|
||||
var (
|
||||
fsTypeVar string
|
||||
driveKeys []string
|
||||
fsTypeVar string
|
||||
stopOnError bool
|
||||
driveKeys []string
|
||||
)
|
||||
|
||||
// Fdisk is the JSON output from libfdisk
|
||||
@ -57,7 +58,12 @@ func autoextend(fsType string) error {
|
||||
continue
|
||||
}
|
||||
if err := extend(d, fsType); err != nil {
|
||||
return err
|
||||
if stopOnError {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Printf("Could not extend partition on device %s. Skipping", d)
|
||||
continue
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@ -312,11 +318,13 @@ func findDrives() {
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&fsTypeVar, "type", "ext4", "Type of filesystem to create")
|
||||
flag.BoolVar(&stopOnError, "stop-on-error", true, "Stops extending the remaining devices on first error")
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
findDrives()
|
||||
|
||||
if flag.NArg() == 0 {
|
||||
if err := autoextend(fsTypeVar); err != nil {
|
||||
log.Fatalf("%v", err)
|
||||
|
@ -6,7 +6,7 @@ init:
|
||||
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
||||
onboot:
|
||||
- name: extend
|
||||
image: linuxkit/extend:cad2e81be336573d9786b168037042900cf0cf0f
|
||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
||||
- name: mount
|
||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||
command: ["/usr/bin/mountie", "/var/lib/docker"]
|
||||
|
@ -9,7 +9,7 @@ onboot:
|
||||
image: linuxkit/modprobe:fad39ef443853ef02520052cdbf6acbeb4ec7799
|
||||
command: ["modprobe", "btrfs"]
|
||||
- name: extend
|
||||
image: linuxkit/extend:cad2e81be336573d9786b168037042900cf0cf0f
|
||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
||||
command: ["/usr/bin/extend", "-type", "btrfs"]
|
||||
- name: mount
|
||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||
|
@ -6,7 +6,7 @@ init:
|
||||
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
||||
onboot:
|
||||
- name: extend
|
||||
image: linuxkit/extend:cad2e81be336573d9786b168037042900cf0cf0f
|
||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
||||
command: ["/usr/bin/extend", "-type", "xfs"]
|
||||
- name: mount
|
||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||
|
@ -6,7 +6,7 @@ init:
|
||||
- linuxkit/runc:8b5af3365fc7d015db4e44113d93c7b1f8e2d2ab
|
||||
onboot:
|
||||
- name: extend
|
||||
image: linuxkit/extend:cad2e81be336573d9786b168037042900cf0cf0f
|
||||
image: linuxkit/extend:9fa90cc4ba8c261b8eb5adacda71feb2f60d75e3
|
||||
- name: mount
|
||||
image: linuxkit/mount:2a507ef30302693682f9f612289028df00c58ac5
|
||||
command: ["/usr/bin/mountie", "/var/lib/docker"]
|
||||
|
Loading…
Reference in New Issue
Block a user