LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 03-19-2020, 03:11 AM   #1
kasv
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Rep: Reputation: Disabled
Post kpartx not removing loop devices while deleting an image in Suse linux 12.4 and greater version


I am trying to mount a backup session of a linux system to browse files and restore files. In order to that I need to mount images of the source. Using command "kpartx -av /imagename" I am doing it successfully. Also this command bind the image with some loop device/s internally. when I am trying to umount the session using "kpartx -d /imagename" command, the loop devices getting deleted in case of suse version 11 but same thing is not happening for suse version greater than 12.4.

is there any requirement to modify udev rules for suse versions greater than 12.4 ( compared to suse linux 11 )to delete loop devices associated with image ( which I am trying to delete through kpartx -d command ) ?

Last edited by kasv; 03-19-2020 at 03:22 AM.
 
Old 03-19-2020, 12:34 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
If you do a second kpartx -a does it not re-use the loop device?
 
Old 03-19-2020, 12:55 PM   #3
kasv
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
@smallpond

No it uses another loop device.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	66
Size:	42.4 KB
ID:	32821  
 
Old 03-19-2020, 03:27 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
To further identify the problem, does "losetup -d ..." succesfully remove the loop device?

Anything interesting in the strace output?
 
Old 03-20-2020, 08:26 AM   #5
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Although the kpartx man page doesn't promise to clean up, I'd call it a bug. The strace output should show if it tries to remove it and fails for some reason. Permissions can mess up good intentions.
 
Old 03-26-2020, 06:33 AM   #6
kasv
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Arrow

Hi Folks

It took me a lot of time to try strace for this issue. Because I was facing an issue while installing strace in Suse from version 12 to 15.

@rknichols "losetup -d .." removes loop device successfully.
Attached the screenshot of my detailed steps and output of trace kpartx( kpartx_d-fail.txt )
Attached Thumbnails
Click image for larger version

Name:	kpartx-d_fail.PNG
Views:	195
Size:	76.9 KB
ID:	32863  
Attached Files
File Type: txt kpartx_d-fail.txt (9.5 KB, 25 views)
 
Old 03-26-2020, 06:59 AM   #7
kasv
LQ Newbie
 
Registered: Mar 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Arrow

one more strace check
Attached Thumbnails
Click image for larger version

Name:	kpartx-d_fail_2.PNG
Views:	113
Size:	18.6 KB
ID:	32865  
Attached Files
File Type: txt kpartx_d-fail-2.txt (13.3 KB, 33 views)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with kpartx and SD card JRHeisey Linux - Virtualization and Cloud 1 07-13-2017 11:51 AM
kpartx fails to mount partition from an image file JRHeisey Linux - Software 3 07-11-2017 06:55 PM
LXer: With greater permissions, comes greater responsibility LXer Syndicated Linux News 0 02-20-2014 03:11 PM
device-mapper error running kpartx on a LVM karateckie Linux - Software 2 12-15-2009 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration