LinuxQuestions.org
Register a domain and help support LQ
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 03-16-2013, 05:30 AM   #1
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: Slackware 14.1
Posts: 393

Rep: Reputation: 30
Unable to remove lvm


I am trying to remove an lvm on my drive which sits in /dev/sda6.

However I don't see to be able to delete it I think maybe /dev is blocking it but not sure as haven't dealt much with lvm before.

This is what I have done.

Code:
kubuntu@kubuntu:~$ sudo df -kh
Filesystem      Size  Used Avail Use% Mounted on
/cow            1.9G  398M  1.5G  21% /
udev            1.9G  8.0K  1.9G   1% /dev
tmpfs           764M  888K  763M   1% /run
/dev/sdb        944M  944M     0 100% /cdrom
/dev/loop0      885M  885M     0 100% /rofs
none            4.0K     0  4.0K   0% /sys/fs/cgroup
tmpfs           1.9G   48K  1.9G   1% /tmp
none            5.0M  4.0K  5.0M   1% /run/lock
none            1.9G   80K  1.9G   1% /run/shm
none            100M   16K  100M   1% /run/user
kubuntu@kubuntu:~$ sudo lvs
  LV   VG                            Attr     LSize  Pool Origin Data%  Move Log Copy%  Convert
  root korora_sayth-travelmate-5740g -wi-a--- 44.60g                                           
  swap korora_sayth-travelmate-5740g -wi-a---  3.73g                                           
kubuntu@kubuntu:~$ sudo umount /
kubuntu@kubuntu:~$ sudo lvremove -f korora_sayth-travelmate-5740g
  Command failed with status code 5.
kubuntu@kubuntu:~$ sudo umount /dev
umount: /dev: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
kubuntu@kubuntu:~$
 
Old 03-16-2013, 05:39 AM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Quote:
"The problem with reality is that it leaves a lot to the Imagination" - John Lenon.

Ah, shouldn't you unmount it and remove it from /etc/fstab

Type,
Code:
umount -a
and then remove the mount point in fstab.

Code:
 cat /etc/mtab
will show what is mounted. And reboot!

You should be able to manipulate the partition after that.

Last edited by GlennsPref; 03-16-2013 at 05:40 AM. Reason: And reboot!
 
Old 03-16-2013, 06:08 AM   #3
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: Slackware 14.1
Posts: 393

Original Poster
Rep: Reputation: 30
Code:
kubuntu@kubuntu:~$ sudo cat /etc/mtab
/cow / overlayfs rw 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev devtmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
/dev/sdb /cdrom iso9660 ro,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
none /run/shm tmpfs rw,nosuid,nodev 0 0
none /run/user tmpfs rw,noexec,nosuid,nodev,size=104857600,mode=0755 0 0
Code:
umount: /run/user: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /run/shm: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /tmp: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /cdrom: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /run: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount: /dev: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

But there is actually nothing in fstab to edit. I need to stop /deve. so lvremove can remove the volume.

fstab
Code:
overlayfs / overlayfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
 
Old 03-16-2013, 06:23 AM   #4
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: Slackware 14.1
Posts: 393

Original Poster
Rep: Reputation: 30
Code:
kubuntu@kubuntu:~$ sudo lvchange korora_sayth-travelmate-5740g
  Need 1 or more of -a, -C, -M, -p, -r, --resync, --refresh, --alloc, --addtag, --deltag, --monitor or --poll
  Run `lvchange --help' for more information.
kubuntu@kubuntu:~$ sudo lvchange -an korora_sayth-travelmate-5740g
kubuntu@kubuntu:~$ sudo lvremove korora_sayth-travelmate-5740g
Do you really want to remove active logical volume swap? [y/n]: y
Do you really want to remove active logical volume root? [y/n]: y
  Command failed with status code 5.
kubuntu@kubuntu:~$ sudo vgremove korora_sayth-travelmate-5740g
Do you really want to remove volume group "korora_sayth-travelmate-5740g" containing 2 logical volumes? [y/n]: y
Do you really want to remove active logical volume swap? [y/n]: y
  Command failed with status code 5.
 
Old 03-16-2013, 07:11 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,897

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
Can you provide some additional information as to what you are trying to accomplish. It appears that you are running a liveCD. /dev /udev are virtual filesystems and only exist in memory.

So what do you have installed on sda? Since no sda filesystems appear to be mounted you can use any tool i.e. parted to remove them.
 
Old 03-16-2013, 07:47 AM   #6
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: Slackware 14.1
Posts: 393

Original Poster
Rep: Reputation: 30
Well I wanted to install kubuntu over fedora kde. However due to the fedora lvm gparted can not remove this. So I needed to delete the lvm to install.


I actually solved this but not in the way I would have liked. As its a dual boot PC I went into the windows partition manager and deleted it.
 
Old 03-16-2013, 08:05 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,897

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
In general most installers will provide the option to delete, use a specified partition or create partitions as desired.
 
Old 03-16-2013, 08:21 AM   #8
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: Slackware 14.1
Posts: 393

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by michaelk View Post
In general most installers will provide the option to delete, use a specified partition or create partitions as desired.
That was my experience previously , however the installers I tried and gparted were unable to. It seems they we're unable to I unmount it to change it.
 
Old 03-16-2013, 03:46 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,275

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Quote:
Originally Posted by flebber View Post
I actually solved this but not in the way I would have liked. As its a dual boot PC I went into the windows partition manager and deleted it.
and the problem is ??? ... lol.

Now it's gone, it'll be hard to be sure, but I'd reckon the installer (or more correctly the liveCD boot sequence) used the swap in the lv. Swap doesn't show in the mount table, but "swapon -s" would have shown it.
Do a "swapoff <blah>" first, then deal with the LVM entities.

I'm actually surprised a Ubuntu derivative recognises and mounts LVM automatically.
 
1 members found this post helpful.
Old 03-16-2013, 03:55 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,199

Rep: Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567
Erase the drive.

LVM records its activity in several places on the disk, so when the system starts, LVM attmepts to look at everything... and picks up on a disk even if you don't want it to.
 
Old 03-16-2013, 03:55 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,897

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
I do not think it was actually mounted either.
 
Old 03-16-2013, 04:23 PM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,275

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Quote:
Originally Posted by jpollard View Post
Erase the drive.
Rubbish.

The OP has already apparently proven this is not necessary.
Distros that automatically run vgchange on boot can be a PITA sometimes (as the OP found out), but no LVM meta-data is stored outside of LVM pv's.
 
Old 03-18-2013, 02:00 AM   #13
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Well, the conf is stored under /etc/lvm, which does not need to be on an LVM eg on the machine I'm typing from, I have no LVM setup at all (don't need or want), BUT
Code:
# pwd
/etc/lvm

# ll
total 52
drwx------. 2 root root  4096 Feb 22 16:21 archive
drwx------. 2 root root  4096 Feb 22 16:21 backup
drwx------. 2 root root  4096 Feb 22 16:21 cache
-rw-r--r--. 1 root root 37554 Feb 22 16:21 lvm.conf
Maybe it was trying to use that from eg an old setup?
 
Old 03-20-2013, 03:23 AM   #14
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 286

Rep: Reputation: 70
I think the problem that OP had, was that he tried lvremove operations on the volume group.
korora_sayth-travelmate-5740g is the name of the volume group.
The logical volumes are named root and swap.

Normal way would be
Code:
lvremove /dev/korora_sayth-travelmate-5740g/root
lvremove /dev/korora_sayth-travelmate-5740g/swap
vgchange -a n korora_sayth-travelmate-5740g
vgremove korora_sayth-travelmate-5740g
 
  


Reply

Tags
dev, lvm, lvremove, remove, udev


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
Manually and forcibly remove LVM configuration Boardy Linux - Software 6 03-06-2011 02:32 PM
LVM Nightmare, how do I remove FUBAR hdd's? x1um1n Linux - Hardware 10 03-20-2009 10:05 PM
Can I remove an LVM easily? Exospaciac Linux - Software 1 08-10-2008 06:27 PM
Correct Way To Remove a Drive from LVM kromberg Linux - Software 1 12-10-2007 09:27 PM
LVM - can't remove vg zdenisl Linux - Software 1 08-16-2007 08:36 AM


All times are GMT -5. The time now is 03:47 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration