Skip to content

Commit 5e82a32

Browse files
committed
use UUID instead of LABEL for better identification for partitions
1 parent 6117a0f commit 5e82a32

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

pkg/storage/filesystem/btrfs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (p *btrfsPool) Device() DeviceInfo {
5353
}
5454

5555
func (p *btrfsPool) prepare() error {
56-
p.name = p.device.Label
56+
p.name = p.device.UUID
5757
if p.device.Used() {
5858
// device already have filesystem
5959
return nil

pkg/storage/filesystem/device.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ type DeviceInfo struct {
5757
Filesystem FSType `json:"fstype"`
5858
Rota bool `json:"rota"`
5959
Subsystems string `json:"subsystems"`
60+
UUID string `json:"uuid"`
6061
Children []DeviceInfo `json:"children,omitempty"`
6162
}
6263

@@ -168,7 +169,7 @@ func (l *lsblkDeviceManager) lsblk(ctx context.Context) ([]DeviceInfo, error) {
168169
args := []string{
169170
"--json",
170171
"-o",
171-
"PATH,NAME,SIZE,SUBSYSTEMS,FSTYPE,LABEL,ROTA",
172+
"PATH,NAME,SIZE,SUBSYSTEMS,FSTYPE,LABEL,ROTA,UUID",
172173
"--bytes",
173174
"--exclude",
174175
"1,2,11",

pkg/storage/storage.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ const (
3636
cacheGrowPercent = 60
3737
cacheShrinkPercent = 20
3838
cacheCheckDuration = 5 * time.Minute
39-
40-
PXELABEL = "ZOSPXE"
4139
)
4240

4341
var (
@@ -201,7 +199,7 @@ func (s *Module) mountPool(device filesystem.DeviceInfo, vm bool) {
201199
log.Debug().Str("path", device.Path).Msg("mounting device")
202200

203201
if device.IsPXEPartition() {
204-
log.Error().Str("device", device.Path).Msg("device has 'zospxe' label")
202+
log.Info().Str("device", device.Path).Msg("device has 'ZOSPXE' label")
205203
s.brokenDevices = append(s.brokenDevices, pkg.BrokenDevice{Path: device.Path, Err: fmt.Errorf("device is a PXE partition")})
206204
return
207205
}

0 commit comments

Comments
 (0)