LinuxQuestions.org
Visit Jeremy's Blog.
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 01-05-2011, 04:44 PM   #1
silvyus_06
Member
 
Registered: Oct 2010
Distribution: Ubuntu 10.04 , Linux Mint Debian Edition , Microsoft Windows 7
Posts: 390

Rep: Reputation: 50
Question What does it happen if i remove drives after i unmount LVM


Ok.

Last night, i was thinking that i'm running out of space on my computer . So i wanted to setup LVM.

I set it up using this LVM guide (which seemed the one that made most sense to me )
I learned that i need to pvcreate /dev/sdX with every device i want .
Then vgcreate and put like : vgcreate name /dev/sdb1 /dev/sdb2
then lvcreate -n name1 --size Xg name
So then i make a file system on it and mount it . My question is :
If i remove a USB flash drive while having unmounted /dev/name/name1 will it harm my LVM setup or something ... i mean , i need space on my laptop , but i also need like 1GB on my usb to take it at school just in case i need to make a presentation or something . ( + that i need a ubuntu live usb on it just in case )

And also , if i want to make my already /home partition that i have larger using lvm , is it possible ?

Last edited by silvyus_06; 01-05-2011 at 04:53 PM.
 
Old 01-05-2011, 05:43 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Hi,

first of all, if you intent to use lvm and store your precious data on it then read a 'real' guide first:
http://tldp.org/HOWTO/LVM-HOWTO/

Afterwards play around with it a bit to get familiar with it. Use lvm2.

Now to your main question:
Quote:
If i remove a USB flash drive while having unmounted /dev/name/name1 will it harm my LVM setup or something
I also do have an external USB hdd which is formatted as lvm. As long as you unmount it and shutdown lvm properly before you unplug it I don't see any problems.
Quote:
And also , if i want to make my already /home partition that i have larger using lvm , is it possible ?
That depends. Is your /home directory already lvm? I suppose not. In that case you will have to back it up first since creating an lvm will destroy all data on it. After lvm is created you will have to format it anyways. Since space is tight, as you said, I assume that the rest of the space is taken up by your / partition, i.e. there is no unallocated space left on the hdd. In this case you will either have to also reinstall using lvm for your root partition, too. LVM will give you some flexibility in changing the size of your logical devices. However, you might want to consider the classical approach of shrinking one partition and growing the other one afterwards.
Code:
man resize2fs
 
Old 01-05-2011, 06:02 PM   #3
silvyus_06
Member
 
Registered: Oct 2010
Distribution: Ubuntu 10.04 , Linux Mint Debian Edition , Microsoft Windows 7
Posts: 390

Original Poster
Rep: Reputation: 50
thanks for the reply . well ... at least now it's clear that it won't happen anything bad . i will read how to "properly" shutdown lvm but any hints here would help lots.

my /home partition is almost full . i can back it up with partimage (had a thread on this ) and will compress it to the maximum .. maybe i can get it sized down to like 4GB to fit on a dvd ... (using like 14 GB on /home right now and it's sizze is 16GB )

the last time i tried the classical approach to make space for a lvm on my usb drive for testing purposes it deleted everything on that FAT32 partition ...

and on my harddisk , i have a corrupt ntfs , which is full of valuable data and is the biggest on my pc . i can't resize it because gparted doesn't let me .. and there's no command that would handle it either .. had a thread on this also ..

anyways this thread is almost solved.
 
Old 01-05-2011, 06:25 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,620

Rep: Reputation: 451Reputation: 451Reputation: 451Reputation: 451Reputation: 451
Quote:
i will read how to "properly" shutdown lvm but any hints here would help lots.
Well, it is not that complicated. For me it was always sufficient to issue these two commands:
Code:
sudo umount /path/to/vol01_mountpoint
sudo umount /path/to/vol02_mountpoint
sudo umount /path/to/vol03_mountpoint
...

sudo vgchange -a n vol_group
I you have only one volume group active on your whole system you can shorten the last command to
Code:
sudo vgchange -a n
This will shutdown every volume group.
 
Old 01-05-2011, 09:43 PM   #5
silvyus_06
Member
 
Registered: Oct 2010
Distribution: Ubuntu 10.04 , Linux Mint Debian Edition , Microsoft Windows 7
Posts: 390

Original Poster
Rep: Reputation: 50
thanks .
 
  


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
LVM REDUCE HOW TO UNMOUNT /dev/volumegroup/lvm crahuldba@gmail.com Linux - Newbie 3 10-29-2010 08:49 AM
Let me what will happen if i remove the following file from Linux server puja1387 Linux - Server 4 04-05-2010 05:34 AM
LVM Partitions Automatically Unmount r_s_karthikeyan Linux - Newbie 1 01-03-2007 08:48 AM
Can't unmount my drives?!?! raid517 Linux - Hardware 5 06-27-2006 06:52 PM
redhat won't reboot also doesn't unmount drives Smerk Linux - Distributions 3 03-24-2003 01:21 AM

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

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