Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lvm on 4 partitions vs lvm on one big partition
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Fri Jan 25, 2013 3:25 pm    Post subject: lvm on 4 partitions vs lvm on one big partition Reply with quote

Is there a difference between installing gentoo on a single partition SSD with LVM (/usr, /home, /var, /tmp, /opt as logical volumes) and installing gentoo on, for example, an SSD with partitions and LVM on each partition?

difference in the sense if the partitioned approach would be more secure or otherwise better.

I would make three partitions:
one is a small encrypted partition to store information like an external Hard drive,

the second would contain /home and LVM to be able to resize /home/user0 and /home/user1 etc, so every user would have a /home/userX logical partition, (does this even make sense? if it doesn't make sense I would put /opt on the second partition too, otherwise LVM wouldn't make sense)

and the third would contain the other directories and would be the "system-partition".
_________________
"I want to see gamma rays! I want to hear X-rays! Do you see the absurdity of what I am? I can't even express these things properly because I have to conceptualize complex ideas in this stupid limiting spoken language!"
Back to top
View user's profile Send private message
greyspoke
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2010
Posts: 98

PostPosted: Fri Jan 25, 2013 5:33 pm    Post subject: Reply with quote

I no expert but I do use LVM in this sort of way so...

You would need a separate physical partition for /boot unless using grub2, and if / was a logical volume that would need an initramfs to activate it.

I have wondered about this. I think what you mean is should you have one volume group on your machine, with as many different logical volumes (what you call logical partitions I assume) in it as you want. Or should you have (say) two volume groups, one for the system - / and separate /usr /var /opt and so on as required, one for all the separate home partitions that you want. I cannot see why you would want to start off with more than one physical partition in each volume group unless you thought you might want to make one smaller by removing a physical volume from it, which is probably unlikely. I can see that you might want to start off not using up all your disk, then there is more space to be added to existing volume groups by adding extra physical volumes as needed, or to be used for something else entirely.

I suppose that having your system partitions in a separate volume group means that there is the option of moving your homes or system volumes to another disk just by by cloning the partitions. Also you can activate and de-activate logical volumes as a group (so in your initramfs you could easily activate your system volume group and mount what you needed from it, you could let the LVM init script deal with the rest). Well it appeared that way to me when I set up our home server (all 500 GiB of it and five users including the cat) so I have three volume groups, "os", "users" and "backup" (backups is what it is mainly there for). But thinking about it, I am not sure it makes a massive amount of difference. LVM definitely makes it easier to shunt space about to where it is needed though.

I would be interested to hear other views on this also.
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Fri Jan 25, 2013 7:27 pm    Post subject: Reply with quote

I didn't mention the /boot partition because I have it on an USB stick. My system is set up like this:
http://forums.gentoo.org/viewtopic-t-945572-highlight-.html and it works quite good and the only reason to do a reinstallation is because I want to document everything I do and don't remember it for my current setup. :) as an exercise and because I thought of creating a separate encrypted partition that wouldn't be mounted automatically.

I had a hard time to formulate what I mean. :) I mean
Quote:
have one volume group on your machine, with as many different logical volumes (what you call logical partitions I assume) in it as you want
or two different physical partitions with one LVM per partition. On one partition the /, /usr, /var, /tmp directories (therefore the "always needed directories") with each on a different logical volume. On the other partition /home and /opt with each of them on a logical volume.

Maybe my question could be formulated as:
Would the second approach do separate the different directories more strictly or is it equal to the first approach?

Quote:
Well it appeared that way to me when I set up our home server (all 500 GiB of it and five users including the cat) so I have three volume groups, "os", "users" and "backup"

in this context my question would be:
is it equal to have one partition with LVM on it, with the three volume groups or to have 3 physical partitions a volume group on each partition, so the system directories would be on the same physical partition but on separate logical volumes.
_________________
"I want to see gamma rays! I want to hear X-rays! Do you see the absurdity of what I am? I can't even express these things properly because I have to conceptualize complex ideas in this stupid limiting spoken language!"
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2448
Location: Germany

PostPosted: Sat Jan 26, 2013 12:09 am    Post subject: Reply with quote

There is no benefit at all to extra partitions in regards to LVM alone.

There is no downside either short of wasting space (LVM metadata, unusable last partial chunk if remaining space is not a multiple of chunksize) and vgscan/lvchange taking longer to set up / modify the mapping.

That said, I do use separate partitions, but for another reason. I have several HDDs and RAID spanning them. RAID can take a long time to resync when a disk fails, and sometimes there are bogus failures (due to disk not waking from standby, power loss, bad blocks affecting only a small area of a disk, ...). There are also very expensive operations (grow). So having several smaller RAIDs, can improve the user experience in some such situations.

Similar can be true for encryption. if dmcrypt/LUKS is still (?) single-process-oriented. In that case separate partitions with separate encrypted containers can mean multiple CPU cores working on encryption in some situations whereas a single big partition there would only ever be one CPU core working. But I'm not 100% up to date on that, multicore support for LUKS was being worked on a long time ago, it might no longer apply.
Back to top
View user's profile Send private message
blain3
n00b
n00b


Joined: 02 Dec 2012
Posts: 30
Location: Southern Pensylvania

PostPosted: Sat Jan 26, 2013 8:38 am    Post subject: Reply with quote

I personally think, and I've gone through the crazy partitioning schemes myself, just the basic few on your SSD, /tmp /var/tmp /usr/portage etc.. using RAM, a /home on a SATA, is much simpler, and I don't see why it would be any less secure. They are also from what I've worked with, painful to manipulate. I could be wrong on this as well, I honestly do not know, but failing sync's at least for me, seemed to happen ( as well as other stupid things failing ) when i had been using several partitions across different HD's.
_________________
#uname -s -m -i -p -v -o -n
Linux
x86_64
GenuineIntel
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
#1 SMP PREEMPT Mon Nov 19 11:17:39 UTC 2012
GNU/Linux
xobtihs
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Sat Jan 26, 2013 4:42 pm    Post subject: Reply with quote

Ok thanks for the replies, so I make one partition for the LVM with /, /usr, /var, /tmp, /home, /opt and swap on separate logical volumes and one partition for a separate encrypted storage device...

I'm not sure if I should mark the thread as solved, because my problem is solved but maybe one can go on discussing..!?
_________________
"I want to see gamma rays! I want to hear X-rays! Do you see the absurdity of what I am? I can't even express these things properly because I have to conceptualize complex ideas in this stupid limiting spoken language!"
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2448
Location: Germany

PostPosted: Sat Jan 26, 2013 6:48 pm    Post subject: Reply with quote

Consider keeping / and /usr on a single partition.

/ is practically empty (if you have partitions for everything) anyway, so there is no downside using it for /usr

At the same time, more and more programs expect /usr to be mounted at bootup (thank you, udev! :x ) which in case of a separate /usr partition means jumping through hoops
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Sat Jan 26, 2013 7:28 pm    Post subject: Reply with quote

Quote:
Consider keeping / and /usr on a single partition.

Well it's too late know, I'm already configuring the kernel :)

yes, I've given / 1GB (which is probably still to large), but except that I probably never have to resize / there isn't any benefit of keeping / on a single partition according to the above (or did I misunderstood something?!).

But /usr can need a resize when there are more and more programs on the system and I don't want to give it 50GB already (I have only 160GB disk space)

the reason for asking this question was that I had the feeling that separate physical partition do "divide" the directories stronger the logical volumes..

[Off topic question: I've read that the reason to create the /usr directory was that early computer had low disk spaces or something in this direction, I don't remember.. So why does /usr even exists? Wouldn't it be possible to have the contents of /usr simply in / ?
In my opinion it's a bit ugly to have so many nested "bin" directories for example, but maybe I don't understand enough...]

Quote:
At the same time, more and more programs expect /usr to be mounted at bootup (thank you, udev! :x ) which in case of a separate /usr partition means jumping through hoops


Does this affect boot time? after entering my password in my last setup there passed quite a time until the messages reappeared (maybe 5-10s), could this be related?
_________________
"I want to see gamma rays! I want to hear X-rays! Do you see the absurdity of what I am? I can't even express these things properly because I have to conceptualize complex ideas in this stupid limiting spoken language!"
Back to top
View user's profile Send private message
blain3
n00b
n00b


Joined: 02 Dec 2012
Posts: 30
Location: Southern Pensylvania

PostPosted: Sun Jan 27, 2013 12:35 am    Post subject: Reply with quote

I'm not sure of the tech reasons behind it, but what he's saying is what i was talking about. partitioning out all of those on a lvm should be *much less* of a problem i would assume, since its technically just one partition.. make any sense?
_________________
#uname -s -m -i -p -v -o -n
Linux
x86_64
GenuineIntel
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
#1 SMP PREEMPT Mon Nov 19 11:17:39 UTC 2012
GNU/Linux
xobtihs
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum