# Will I need an initrd for lvm2?

## LostInGentoo

Hi

I found several discussion on how to avoid using initrd when using lvm.

However, I have come to no conclusions! Will I need it with the following setup:

LVM partitions:

5G	/opt

5G	/tmp

5G	/var

100G	/home

40G	/usr

Normal partitions

128M	./boot

Regards

Preben

----------

## DaggyStyle

the most important partition is missing, if you / is on lvm, then you need initrd.

----------

## LostInGentoo

Yes, the / is not to be lvm (since then I would need the initramfs, which I have not tried to create before and I find no guides on how to do this and whether there are any benefits of using it)

How large should / be?

5G??

I use less than 1G currently on my gentoo box for / without the tmp,  usr, opt, var, home, boot

----------

## DaggyStyle

 *LostInGentoo wrote:*   

> Yes, the / is not to be lvm (since then I would need the initramfs, which I have not tried to create before and I find no guides on how to do this and whether there are any benefits of using it)
> 
> How large should / be?
> 
> 5G??
> ...

 

mine is 25GBI think.

that is because /usr is part of it.

----------

## gentoo_ram

My setup has / not on LVM and everything else is on LVM.  Pretty straight forward, and don't need an initrd.  I currently have 4G allocated to /.  But honestly I wish I might have put a little more.  Some programs which I run as root place some caches and other crap in root's home directory which fills up / a bit.  If you are really constrained for disk space, 4G is plenty.  But if not, might as well put like 10G-15G there.  With 2 or 3 TB drives out there, you won't really notice.    :Smile: 

My partitions:

```
/dev/root on / type ext4 (rw,noatime,commit=0)

/dev/mapper/vg-usr on /usr type ext4 (rw,noatime,commit=0)

/dev/mapper/vg-opt on /opt type ext4 (rw,noatime,commit=0)

/dev/mapper/vg-home on /home type ext4 (rw,nosuid,nodev,noatime,commit=0)

/dev/mapper/vg-tmp on /tmp type ext4 (rw,nosuid,nodev,noatime,commit=0)

/dev/mapper/vg-vtmp on /var/tmp type ext4 (rw,nosuid,nodev,noatime,commit=0)

/dev/mapper/vg-log on /var/log type ext4 (rw,noexec,nosuid,nodev,noatime,commit=0)

```

I separated these out for a couple reasons.  First, I wanted logging separate to prevent some runaway log from messing up the system.  The rest are separate so I could lock down the security a little more (nosuid, nodev, noexec on log, etc).  You need a decent amount of space in /var/tmp since that's where the portage builds happen.  I have 12G in /var/tmp and that's been enough for any package I've compiled so far.  /tmp can probably be quite a bit smaller though.

----------

## greyspoke

See here.  I recently discovered this, which I think answers the issue discussed here (which I've just added to).  You may find some startup services whingeing at you becasue they can't find the files they need because they are on /usr which isn't there yet.  On my desktop system I have /usr on lvm and don't load it at early boot in an initramfs and have so far managed to work round this or just ignore the whingeing.  But I guess at some time I will have to go that way.

----------

## frostschutz

 *LostInGentoo wrote:*   

> Yes, the / is not to be lvm (since then I would need the initramfs, which I have not tried to create before and I find no guides on how to do this and whether there are any benefits of using it)

 

Genkernel would do it automatically for you (under ideal conditions anyway)

and there is a guide on how to manually make an initramfs in the Wiki http://en.gentoo-wiki.com/wiki/Initramfs - it's easy to do if you already know shell scripting.

I have root on LVM because I want the same comfort/benefit that LVM offers for all partitions.

----------

