disk: ability to grow existing partitions
Apply the minimum size specified in the file system customizations also to existing partitions. Specifically, this now allows to set a minimum size also for the root partition.
This commit is contained in:
parent
97754a2c99
commit
b6cece8b28
1 changed files with 8 additions and 1 deletions
|
|
@ -34,7 +34,14 @@ func CreatePartitionTable(
|
|||
|
||||
for _, m := range mountpoints {
|
||||
sectors := table.BytesToSectors(m.MinSize)
|
||||
if m.Mountpoint != "/" {
|
||||
|
||||
// if we already have a partition ensure that the
|
||||
// size is at least the requested size, otherwise
|
||||
// create a new filesystem with that size
|
||||
part := table.FindPartitionForMountpoint(m.Mountpoint)
|
||||
if part != nil {
|
||||
part.EnsureSize(sectors)
|
||||
} else {
|
||||
table.CreateFilesystem(m.Mountpoint, sectors)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue