LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-14-2009, 11:03 PM   #1
lhorace
Member
 
Registered: Aug 2009
Distribution: Fedora
Posts: 126

Rep: Reputation: 21
Question about LVM2, adding and removing PV


My Linux OS is mounted on a LVM spread across an 8GB SD Card and a 4GB Flash Drive. I've used about 6GB and have about 2.xGB left. I'm trying to download Sabayon and I don't quite have enough space to store DVD size iso. I have extra 2GB Flash Drive that I am not using and can converted to a PV and that would give me the nesscary space I need to store the ISO. Now the ISO would spread from 4GB Flash to my 2GB Flash. My question is complicated, so bare with me. I want to know by adding 2GB PV into LogGroup and then remove it from the same LogGroup and then added back later. Would the data still exists and accessible? What happenes to the data when I remove it the first time, would be automatically deleted, or stay hidden to plug back in?

Thanks for anyone who could help me understand with this...
 
Old 09-15-2009, 03:04 PM   #2
lhorace
Member
 
Registered: Aug 2009
Distribution: Fedora
Posts: 126

Original Poster
Rep: Reputation: 21
Anyone has any idea about my questions?
 
Old 09-15-2009, 04:14 PM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
Depends what you mean by 'remove'.

If you use pvremove to remove the PV from the volumegroup then any LVs (filesystems) with an allocation on that PV either in part or in full will be deleted during the pvremove processing.

If you mean just physically remove the flash drive while the volume group is offline, without running pvremove, then the volume group will fail to come online the next time you try and activate it as it won't work without all it's member PVs being available. However, once all its member PVs are available again you should be able to bring it online without any data loss (assuming you haven't done anything to it in the mean time).

If you mean physically remove the flash drive while the volume group is still online, then you're almost certainly looking at corruption and data-loss.


In short, I don't think what you're thinking of doing will work, though I'm not clear why you need to add it, remove it and then add it again.
 
Old 09-15-2009, 05:20 PM   #4
lhorace
Member
 
Registered: Aug 2009
Distribution: Fedora
Posts: 126

Original Poster
Rep: Reputation: 21
I see, no matter what, the data will be lost by adding and removing it.. Someone told me that offline, I remove it, the system will continue to boot, but just complain that it is not there...

I hate having 2 flash drives sticking out of my notebook in fear that one would hit something and fail. So I was thinking if it was possible to temporally use it when I want to and keep aside when I don't want too, and keep the data intact using lvm. Simply using it as a flash drive won't work because it doesn't have enough room for the type of application I wanted to use it for. Combining with the rest of my drive was preferred way I wanted it to be..

I'm utter-ally broke otherwise I would have sprung for new HDD after mines failed...

Last edited by lhorace; 09-15-2009 at 05:29 PM.
 
Old 09-15-2009, 05:54 PM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
Quote:
Originally Posted by lhorace View Post
I see, no matter what, the data will be lost by adding and removing it.. Someone told me that offline, I remove it, the system will continue to boot, but just complain that it is not there...
That's true as long as your root-filesystem isn't also on that same volume-group. In your example if you had put your rootfs on the 8G sd card, and the two flash drives as PVs in a separate volumegroup just for your data, then you could safely take them offline and unplug the two flash drives whenever you wanted. If all 3 are in the same volume group, then all 3 need to be available to boot the system.

You can force a volume group online that has missing PVs, but it's not advisable and should really only be done in a recovery situation.
 
  


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
Removing a drive from LVM2 ... tomazN Linux - Software 5 10-14-2009 08:55 AM
Removing GNOME and adding IceWm BlahBlah_X Ubuntu 3 02-26-2007 08:48 PM
use lvm2 I have some question? zhuningwll Slackware 3 05-03-2006 01:35 AM
Adding/removing SATA drive redoaks Linux - Newbie 5 03-09-2006 06:34 AM
removing and adding route juanb Linux - Networking 1 04-03-2005 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:51 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