LinuxQuestions.org
Review your favorite Linux distribution.
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 01-16-2017, 11:28 PM   #1
haseem saeed
Member
 
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34

Rep: Reputation: Disabled
Unhappy doubtful about lvm


hi ,

i have a question in my mind about lvm ,as i am new to linux i want you guys to help me out in this..so let me explain

suppose i have created lvm on my hard disk which is of 80gb . i have some data of about 40 gb inside that lv and now i want to reduce that lv from 80 to 60 gb .now the question is, where will my data go ? i mean will it remain in that 60 gb part or it will be divided which i guess should not happen .or the data will be lost ?


thanks in advance ,
Haseem saeed.
 
Old 01-17-2017, 04:41 AM   #2
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
Look at: lvresize -r (--resizefs) in man page

Basically, this is often done; if done right, no loss; if done wrong, disaster!
Shrinking the device without first shrinking the filesystem will destroy the filesystem.

Here's a LQ Thread that might be relevant, found from a web-search of:
lvreduce|lvresize tutorial move data

Welcome to LQ! Let us know what you will try or further questions after reading for a while.

p.s. post relevant info, like: pvs;vgs;lvs;lsblk -fp ...etc

Last edited by Jjanel; 01-17-2017 at 05:17 AM.
 
Old 01-17-2017, 06:06 AM   #3
haseem saeed
Member
 
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34

Original Poster
Rep: Reputation: Disabled
Smile "thank you so much"

Quote:
Originally Posted by Jjanel View Post
Look at: lvresize -r (--resizefs) in man page

Basically, this is often done; if done right, no loss; if done wrong, disaster!
Shrinking the device without first shrinking the filesystem will destroy the filesystem.
"thank you so much"
it is indeed very informative . but the thing is, i am actually finding something for my own logic. i mean i know for shrinking or for reducing a logical volume you first have to unmount it and then the resizing thing .but what i have asked for is that what will happen with the data i mean on which side it will go .i mean i need the concept and definitely the explanation for it ..
thank you again

Here's a LQ Thread that might be relevant, found from a web-search of:
lvreduce|lvresize tutorial move data

Welcome to LQ! Let us know what you will try or further questions after reading for a while.

p.s. post relevant info, like: pvs;vgs;lvs;lsblk -fp ...etc
"thank you so much"
it is indeed very informative . but the thing is, i am actually finding something for my own logic. i mean i know for shrinking or for reducing a logical volume you first have to unmount it and then the resizing thing .but what i have asked for is that what will happen with the data i mean on which side it will go .i mean i need the concept and definitely the explanation for it ..
thank you again
 
Old 01-18-2017, 08:50 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
When you resize the volume, one option that's available will (first) resize the file system, thus protecting your data. (Any data that is located in areas of the volume that are about to disappear will be moved out of harm's way.)

In my opinion, you always want to use LVM, and you'll see why the moment that your hard drive fills up.

Without LVM, that's a very messy situation to get out of. With LVM it is easy: just add another physical volume, map it to the appropriate logical pool, and resize the filesystem upward. Done. (And you don't even have to reboot the system.)

LVM separates the logical notion of a "mount point" from the physical resource(s) that correspond to it, allowing the data to be distributed among many physical volumes in various useful ways.

Don't be "doubtful" about this important feature. Use it!

Last edited by sundialsvcs; 01-18-2017 at 08:52 AM.
 
1 members found this post helpful.
Old 01-18-2017, 10:51 PM   #5
haseem saeed
Member
 
Registered: Jan 2017
Location: karachi,Pakistan
Distribution: Centos,Ubuntu
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
When you resize the volume, one option that's available will (first) resize the file system, thus protecting your data. (Any data that is located in areas of the volume that are about to disappear will be moved out of harm's way.)

In my opinion, you always want to use LVM, and you'll see why the moment that your hard drive fills up.

Without LVM, that's a very messy situation to get out of. With LVM it is easy: just add another physical volume, map it to the appropriate logical pool, and resize the filesystem upward. Done. (And you don't even have to reboot the system.)

LVM separates the logical notion of a "mount point" from the physical resource(s) that correspond to it, allowing the data to be distributed among many physical volumes in various useful ways.

Don't be "doubtful" about this important feature. Use it!
thanks .definitely i will :-)
 
Old 01-18-2017, 11:25 PM   #6
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
Hi again. I hope you have the info you wanted.
>what will happen with the data[?] on which side it will go[?]
It will be moved to the filesystem ['side']. Like Windows <<<<link

I find info like this <<<<link from a web-search of: lvresize move data

By "doubt", I believe you mean "question" (not disbelieve).

Best wishes! Your questions are welcome; feel free to ask!

p.s. IF resolved, please use ThreadTools, at top, to mark '[SOLVED]'.

Last edited by Jjanel; 01-18-2017 at 11:33 PM.
 
  


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
Problem with LVM mirror and failed PV, can't recover -- Debian Squeeze lvm 2.02.66-5 Linux Ninja Linux - Server 2 06-02-2017 04:50 PM
LVM and RAID - will I get better throughput or recoverability vs linear lvm? jdelaporte Linux - Server 2 09-06-2015 09:28 AM
LVM and encrypted lvm - vgchange -ay needed everytime andrew44 Linux - Server 2 04-19-2014 08:47 PM
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 12:59 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM

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

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