LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-14-2009, 04:02 PM   #1
karateckie
LQ Newbie
 
Registered: Dec 2009
Posts: 7

Rep: Reputation: 0
device-mapper error running kpartx on a LVM


Hello, I'm hoping this explanation will have everything needed, just let me know what other info I need to gather.

-CentOS 5.4
-Kernel 2.6.18-164.el5xen

I use Xen to host a Windows virtual.
I have 3 volume groups configured, one for the Host (CentOS), for the guest OS setup (Windows Server 2008) and one for the data storage. The data LV is added to the Windows guest for access. Both the data and guest LVs are formatted NTFS.

I've got installed and working ntfs-3g to allow me to mount the NTFS LVs. I'm using kpartx to create a map for the LV partitions. Last week I was able to mount the guest's LV (read only to avoid issues) and browse the file system. Today, I wanted to take a backup so I tried to mount it again and I am receiving the following error:

#kpartx -av /dev/Guest/Server2008
device-mapper: reload ioctl failed: Invalid arguement
add map Server2008p1 : 0 92327928 linear /dev/Guest/Server2008 2048

#tail /var/log/messages
Dec 14 15:56:54 Virt-84 kernel: device-mapper: table: device /dev/Guest/Server2008 too small for target
Dec 14 15:56:54 Virt-84 kernel: device-mapper: table: 253:8: linear: dm-linear: Device lookup failed
Dec 14 15:56:54 Virt-84 kernel: device-mapper: ioctl: error adding target to table

Here's the kicker, I am able to run kpartx on the LV for the Data storage, and mount it read only via ntfs-3g afterwards without issue. I can't think of anything that's changed with the Guest LV that would affect this. Any ideas?

Thanks!
Kara
 
Old 12-15-2009, 03:24 PM   #2
karateckie
LQ Newbie
 
Registered: Dec 2009
Posts: 7

Original Poster
Rep: Reputation: 0
I've been reviewing my notes for what I had set up on this server.

I think I may have found something applicable. I successfully mounted the NTFS guest LV once before I needed to shrink the LV. I first shrank the partition from within the Guest, and then used the system-config-lvm GUI to shrink the LV. Could this have caused the issue?
 
Old 12-15-2009, 04:13 PM   #3
karateckie
LQ Newbie
 
Registered: Dec 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Smile

Shrinking the volume is what caused the issue. Once I restored it to the original size, kpartx was able to map a device without issue.

Now if anyone can answer this question:
The filesystem was shrank first, then the logical volume, and everything except kpartx continued to work. Did I miss a step in shrinking the volume? I can see the need to shrink a LV in the future, and would like to make sure I do it correctly. But overall *yay*, it's fixed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Building using live CD - device mapper error Robhogg Linux From Scratch 3 04-12-2009 04:06 PM
Is device-mapper necessary if you don't use LVM? raypen Linux - Software 1 06-23-2008 06:17 AM
LVM problems, device-mapper missing dworkin Linux - Newbie 3 03-22-2004 04:54 PM
lvm 2 device-mapper Kroenecker Linux - Newbie 4 12-29-2003 11:19 AM
LVM and device-mapper instalation- Help zick Linux - General 0 10-29-2003 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:31 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration