LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-11-2014, 08:47 AM   #1
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Unable to remove partition from device-mapper


Problem: /dev/sdb1 is always recognized as lvm/dm partition.
Cause: Myself... ("SBT" in Swedish. )

A 500GB disk with one partition on it was used for OpenSuse raid.
Now I ditched the server, removed the disk - without removing it from raid!
This disk is now second disk in a new server, with OS on it's first disk.
But the disk and the partition /dev/sdb1 always turns up in /dev/mapper.
When I mount /dev/sdb1 it is recognized as /dev/mapper/1ATA_WDC_WD5002ABYS-18B1B0_WD-WCASYE035842p1
It seems everything works, but I am still worried about this. This partition is now type 83 ext4, and not used in any raid or lvm.
And the server is to be a production server, it's an oVirt node.

What I have done to fix the issue:
Tried to remove from dm:
Code:
dmsetup remove  /dev/mapper/1ATA_WDC_WD5002ABYS-18B1B0_WD-WCASYE035842p1
dmsetup remove  /dev/mapper/1ATA_WDC_WD5002ABYS-18B1B0_WD-WCASYE035842
This was my first try, also did this first thing before trying other things.
The /dev/mapper/ entries are removed, mounting now looks good - but it doesn't persist after reboot.

So I continued:
I used shred on the entire disk (#shred /dev/sdb)
I zeroed out the beginning and end, when that didn't change anything I also zeroed out entire disk:
Code:
dd bs=512 if=/dev/zero of=/dev/sdb count=8196 seek=$((`blockdev --getsz /dev/sdb` - 8196))
dd if=/dev/zero |pv| dd of=/dev/sdb bs=8192
Changed /dev/sdb1 to lvm in the hope it could then be removed permanently from device-mapper.
Did not work.

The system is using lvm so I can't just deinstall it:
Code:
/dev/mapper/vg_node1-lv_root   	50G   12G   36G  24% /
tmpfs                  			16G     0   16G   0% /dev/shm
/dev/sda1             			485M   55M  405M  12% /boot
/dev/mapper/vg_node1-lv_od		164G  6,2G  150G   4% /ct/od
There is no 'dm' command.
 
Old 06-11-2014, 10:45 AM   #2
potato_farmer
Member
 
Registered: May 2014
Posts: 55

Rep: Reputation: Disabled
What's the output of the following commands?

# pvs

# vgs

# lvs
 
Old 06-11-2014, 10:51 AM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Original Poster
Rep: Reputation: 127Reputation: 127
[root@ctnode1 ~]# pvs
Code:
PV         VG       Fmt  Attr PSize   PFree
  /dev/sda2  vg_node1 lvm2 a--  232,34g    0
[root@ctnode1 ~]# vgs
Code:
  VG       #PV #LV #SN Attr   VSize   VFree
  vg_node1   1   3   0 wz--n- 232,34g    0
[root@ctnode1 ~]# lvs
Code:
 LV      VG       Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  lv_od   vg_node1 -wi-ao---- 166,60g                                             
  lv_root vg_node1 -wi-ao----  50,00g                                             
  lv_swap vg_node1 -wi-ao----  15,74g
So only vg_node1 is actually there. This is the vg holding my system partitions.
 
Old 06-11-2014, 10:58 AM   #4
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
lvm creates backup and archive files under /etc/lvm/. You may need to update those before rebooting. See vgcfgbackup.
 
Old 06-11-2014, 11:18 AM   #5
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Original Poster
Rep: Reputation: 127Reputation: 127
Thanks, but that didn't help either.
I deleted (after backup-ing) /etc/lvm/archive/ /etc/lvm/backup/ /etc/lvm/cache/.cache and rebooted, no change.
 
  


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
[SOLVED] Memory Leak Installing Slackware 14.1 32-bit to Device Mapper partition? Erik_FL Slackware 2 01-19-2014 10:24 PM
[SOLVED] device-mapper: remove ioctl on failed: Device or resource busy jheengut Linux - Kernel 1 10-23-2013 08:38 AM
how to remove disk partition metadata for /dev/mapper/ddf1_* duderonomy Linux - Hardware 2 03-09-2012 03:22 PM
unable to find device-mapper major/minor? help!!!!! can't boot up! kernel panic! newtovanilla Linux - Newbie 5 11-23-2008 02:39 PM
remove a device mapper partion charlie951 Linux - Hardware 2 04-05-2007 09:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:33 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
Open Source Consulting | Domain Registration