File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -163,14 +163,19 @@ def add_entry(
163163
164164 lsblk = self .node .tools [Lsblk ]
165165 try :
166- disk = lsblk .find_disk_by_mountpoint (mount_point , force_run = True )
167- device = disk .device_name
166+ # Try to find partition first
167+ partition = lsblk .find_partition_by_mountpoint (mount_point , force_run = True )
168+ device = partition .device_name
168169 except LisaException :
169- raise LisaException (
170- f"Could not auto-detect device for mount point { mount_point } . "
171- "Please provide device parameter."
172- )
173-
170+ try :
171+ # Fall back to disk if partition not found
172+ disk = lsblk .find_disk_by_mountpoint (mount_point , force_run = True )
173+ device = disk .device_name
174+ except LisaException :
175+ raise LisaException (
176+ f"Could not auto-detect device for mount point { mount_point } . "
177+ "Please provide device parameter."
178+ )
174179 # Convert to UUID if requested
175180 device_str = device
176181 if use_uuid and device .startswith ("/dev/" ):
You can’t perform that action at this time.
0 commit comments