Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] lvm2 for root, swap and software suspend2 (edit)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
swingkyd
Guru
Guru


Joined: 13 Jan 2005
Posts: 334

PostPosted: Fri May 30, 2008 3:54 pm    Post subject: Reply with quote

maybe this is a dumb question but... why must we use initrd? I have never used it for my gentoo box...so why would I need it for this?
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Fri May 30, 2008 4:06 pm    Post subject: Reply with quote

You don't need to unless you want to use something non-standard/built in for your root. In my case, I wanted everything on my system to be in lvm. That included swap and suspending/resuming from that swap. To do this, you need to use an initrd.
Back to top
View user's profile Send private message
188562
Apprentice
Apprentice


Joined: 22 Jun 2008
Posts: 186

PostPosted: Mon Jun 23, 2008 3:39 pm    Post subject: Thanks Reply with quote

Thank you for the excellent work Raffi !
It is unfortunate that your script is not working under baselayout2 :cry:
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Mon Jun 23, 2008 3:45 pm    Post subject: Reply with quote

It is for me. If you are having problems, please send me the error.
Back to top
View user's profile Send private message
188562
Apprentice
Apprentice


Joined: 22 Jun 2008
Posts: 186

PostPosted: Mon Jun 23, 2008 4:19 pm    Post subject: Reply with quote

I tried your script in a stable system and everything worked perfectly afterwards was an attempt to implement all the same under baselayout2. Unfortunately, under baselayout2 I have nothing left. If memory serves me is not the error was

No volume groups found

and before that even when the assembly initrd-lvm2 script could not create the necessary device.

But if it still works then I will just glad. This means that where I had committed a mistake.
In any case, thanks.
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Mon Jun 23, 2008 4:25 pm    Post subject: Reply with quote

Be sure to re-grab the script as it changed when I added support for baselayout2. The support for baselayout2 was only necessary for creating the initrd on a baselayout2 machine. The old script could boot a machine that had baselayout2 on it as long as the initrd was created on a baselayout1 machine.

If you get errors when running the script, you can assume that the script will probably not work right when booting the machine. In this case, send me the errors and I can try to help.
Back to top
View user's profile Send private message
saberspark77
n00b
n00b


Joined: 03 Aug 2005
Posts: 10
Location: Fairfax, VA

PostPosted: Fri Jun 27, 2008 4:01 pm    Post subject: Reply with quote

I had to make a slight modification to the script. Apparently TuxOnIce now suggests that its options be passed as resume=, rather than resume2=, and noresume rather than noresume2. I simply changed all occurrences of resume2 to resume, but since I believe both are still valid, you may want to write in a test for either of them...
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Fri Jun 27, 2008 4:05 pm    Post subject: Reply with quote

This should probably be an option. Last time I installed it on my tuxonice, the docs said resume instead of resume2 and that did not work at all.

I think there ha been a recent update to tuxonice, I will look again.
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Fri Jun 27, 2008 4:11 pm    Post subject: Reply with quote

Please post the changes you made so that I can be sure I'm addressing your issue. Looking at my script, it does look like I'm already doing what you suggested.
Back to top
View user's profile Send private message
lkraav
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2004
Posts: 129
Location: Estonia

PostPosted: Sat Jul 19, 2008 1:24 pm    Post subject: Reply with quote

hi raffi,


would you consider putting your script under some version control, just mark each edit with a new version nr with some # comment line? i am assuming right now the script in the first post is the latest modified version, right.
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Sat Jul 19, 2008 6:01 pm    Post subject: Reply with quote

The script in the first post is the latest. I have arbitrarily assigned a version of 2.0 to the script. I will try to remember to update the number when I change things.
Back to top
View user's profile Send private message
lkraav
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2004
Posts: 129
Location: Estonia

PostPosted: Tue Jul 22, 2008 1:05 pm    Post subject: Reply with quote

as a side note - i now have a situation where i have some different configurations, some with raid, some with lvm2, some with both, some with luks included and i decided to move everything to tuxonice init script architecture - http://wiki.tuxonice.net/EncryptedSwapAndRoot

unfortunately this mechanism still lacks a good manual initramfs creation mechanism. right now i compile my initramfs into the kernel with the builtin mech, this lets me do a good build mechanism, but really sucks when you have to change something small in the init script.

but at the same time, stuff like uvesafb+v86d now uses the kernel builtin mechanism, so its kinda hard to move away from this too.

raffi, my vision is, that your script has been largely superseded in basic functionality when it comes to init, but it definitely has unique value in simply letting one create an initramfs quickly. ideally, that functionality would be integrated with tuxonice init mechanism, which in my view is the best (most functional) one available at the moment. it also needs only minor modifications for lvm2 + raid handling (which i already did on my systems). i dont see a point in having many of these different but same init scripts, i think everyone would benefit if there was an effort merger. ive already contacted alon lev bar (tuxonice) about this and he says all patches are welcome. the bad thing is i am not seeing any shared development tools, like repository and stuff, but perhaps all that could be worked out.

what are your thoughts on this, raffi?
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Sat Jul 26, 2008 5:19 pm    Post subject: Reply with quote

I have never looked at the tuxonice init stuff. I will have to find time to take a look.
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Sun Jul 27, 2008 4:24 am    Post subject: Reply with quote

A quick look at the tuxonice page you posted a link to seems to me that we simply have two different goals. I'm using the same kernel mechanism that the tuxonice stuff is using. I just started with the lvm init scripts and modified things for my needs.

I have not been very interested in writing a generic do every possible thing initramfs, I've just added features that I have need of when I run into problems. Feel free to borrow/steal/re-write any portion as patches or add ons to the the tuxonice encryption stuff. If you come up with a generic way of adding features, I might end up switching :-)
Back to top
View user's profile Send private message
tekknokrat
Apprentice
Apprentice


Joined: 17 Apr 2005
Posts: 278
Location: Magdeburg

PostPosted: Sun Jun 14, 2009 2:27 pm    Post subject: Reply with quote

Using this script with current baselayout2 and gentoo-source's kernel the initrd fails with this error message:

Quote:
mdadm: no devices found for /dev/md0


I want to use a lvm2 root within a degraded soft-raid1 array.

initrd was created via this cmd:
Code:
./create_lvminitrd.sh --raid /dev/md0 --raidconf /etc/mdadm.conf -M gentoo-b2 -m /lib/modules/2.6.29-gentoo-r5/kernel/drivers/md/dm-mod.ko -c /etc/lvm/lvm.conf 2.6.29-gentoo-r5


boot option:

Code:
title Gentoo Linux 2.6.29-r5
root (hd0,0)
        kernel /kernel-genkernel-x86_64-2.6.29-gentoo-r5 root=/dev/ram0 lvm2root=/dev/vg/gentoo-root
        initrd /initrd-lvm2-2.6.29-gentoo-r5.gz


mdadm.conf:
Code:
DEVICE partitions
MAILADDR root

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b3ddb736:02e9ccd6:ef7779b1:049da636


kernel config based on genkernel default config, only raid is builtin:
Code:

# grep RAID /usr/src/linux/.config
CONFIG_RAID_ATTRS=m
CONFIG_BLK_DEV_3W_XXXX_RAID=m
CONFIG_SCSI_AACRAID=m
CONFIG_MEGARAID_NEWGEN=y
CONFIG_MEGARAID_MM=m
CONFIG_MEGARAID_MAILBOX=m
CONFIG_MEGARAID_LEGACY=m
CONFIG_MEGARAID_SAS=m
# CONFIG_MD_RAID0 is not set
CONFIG_MD_RAID1=y
# CONFIG_MD_RAID10 is not set
# CONFIG_MD_RAID456 is not set

# grep DM_ /usr/src/linux/.config
# CONFIG_DM_DEBUG is not set
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
CONFIG_DM_MIRROR=m
CONFIG_DM_ZERO=m
CONFIG_DM_MULTIPATH=m
# CONFIG_DM_DELAY is not set
CONFIG_DM_UEVENT=y
CONFIG_BLK_DEV_DM_BBR=m
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set


- sys-apps/baselayout-2.0.1 was built with the following:
USE="(multilib) -build"
- sys-kernel/gentoo-sources-2.6.29-r5 was built with the following:
USE="(multilib) -build -symlink"
_________________
Optimism is solely an absence of information. / Optimismus ist nur ein Mangel an Information.
(Arthur Schopenhauer)
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Sun Jun 14, 2009 2:33 pm    Post subject: Reply with quote

It sounds like you don't have the correct disk drivers loaded. What do you get if you type the following in the rescue mode

fdisk -l
Back to top
View user's profile Send private message
tekknokrat
Apprentice
Apprentice


Joined: 17 Apr 2005
Posts: 278
Location: Magdeburg

PostPosted: Sun Jun 14, 2009 2:40 pm    Post subject: Reply with quote

Raffi wrote:
It sounds like you don't have the correct disk drivers loaded. What do you get if you type the following in the rescue mode

fdisk -l


does fdisk -l from fedora installation on the same box suffice?

Code:

$ sudo fdisk -l
[sudo] password for gthielebein:

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe7ace7ac

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          63      506016   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64         586     4193784   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3           17086       77825   487894050    5  Extended
Partition 3 does not end on cylinder boundary.
/dev/sda5           17086       77825   487894018+  fd  Linux raid autodetect


You just reminded me to include the sata_sil drivers because they are also build as module only:

Code:
# grep SIL /usr/src/linux/.config
CONFIG_SATA_SIL24=m
CONFIG_SATA_SIL=m
CONFIG_PATA_SIL680=m
# CONFIG_SSB_SILENT is not set
# CONFIG_FB_ASILIANT is not set

_________________
Optimism is solely an absence of information. / Optimismus ist nur ein Mangel an Information.
(Arthur Schopenhauer)
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Sun Jun 14, 2009 2:43 pm    Post subject: Reply with quote

tekknokrat wrote:

does fdisk -l from fedora installation on the same box suffice?


Nope, we are looking to see if you have the drivers in this install.

tekknokrat wrote:

You just reminded me to include the sata_sil drivers because they are also build as module only:


That would probably be the problem.
Back to top
View user's profile Send private message
tekknokrat
Apprentice
Apprentice


Joined: 17 Apr 2005
Posts: 278
Location: Magdeburg

PostPosted: Sun Jun 14, 2009 3:08 pm    Post subject: Reply with quote

Raffi wrote:
tekknokrat wrote:

does fdisk -l from fedora installation on the same box suffice?


Nope, we are looking to see if you have the drivers in this install.

tekknokrat wrote:

You just reminded me to include the sata_sil drivers because they are also build as module only:


That would probably be the problem.


Tried with integrating the sil_ata but the error remains, I can't access the shell because of this:

Code:
/bin/ash: can't access tty: job control turned off


I wonder what is now missing in default gentoo-sources config.
_________________
Optimism is solely an absence of information. / Optimismus ist nur ein Mangel an Information.
(Arthur Schopenhauer)
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Sun Jun 14, 2009 6:58 pm    Post subject: Reply with quote

The job control message should not be a problem. If you add lvm2rescue to the command line, you should be able to type. You will need to either load the correct modules with the script, or compile in the correct disk drivers into your kernel. Not knowing what you are running, I can't tell you what that would be.
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Sun Jun 14, 2009 9:13 pm    Post subject: Reply with quote

The job control message should not be a problem. If you add lvm2rescue to the command line, you should be able to type. You will need to either load the correct modules with the script, or compile in the correct disk drivers into your kernel. Not knowing what you are running, I can't tell you what that would be.
Back to top
View user's profile Send private message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 267
Location: Utility Muffin Research Kitchen

PostPosted: Mon Sep 28, 2009 11:46 pm    Post subject: Re: [HOWTO] lvm2 for root, swap and software suspend2 (edit) Reply with quote

Raffi wrote:
2) Create logical partitions for [...] swap

But:
"Try to put your swap partitions near the beginning of your drive".
And, Gentoo documents creating swap immediately after boot.

Given the above I can think of a reason to have swap not in a logical volume, but I can't think of a reason to have it in a LV. Root? Yes. Swap? ?

Regards

Fog Watch.
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Mon Sep 28, 2009 11:53 pm    Post subject: Re: [HOWTO] lvm2 for root, swap and software suspend2 (edit) Reply with quote

Fog_Watch wrote:
Raffi wrote:
2) Create logical partitions for [...] swap

Given the above I can think of a reason to have swap not in a logical volume, but I can't think of a reason to have it in a LV. Root? Yes. Swap? ?


I did it because I can. Kind of like why people climb mountains.

As for how well it works, I usually have a small swap partition for emergencies only, ANY swap is way too slow. Memory is cheap enough now you should probably not be using it much any more. Not like the days when you wanted 2x swap to memory.
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2336
Location: Kentucky

PostPosted: Sun Jan 10, 2010 6:42 pm    Post subject: Reply with quote

I have been using gentoo-sources for 6 years now. I am working on my first gentoo laptop install, details are at:

https://forums.gentoo.org/viewtopic-t-809431-postdays-0-postorder-asc-start-0.html

I am wondering if I still need to use suspend2-sources to use your method.

I also plan to eventually go with RAID-1 as well as LVM2 on the root filesystem, but for now I am just using a simple 320 GB drive. Since I have 8 GB, it is usually easier to sleep than to hibernate. Does your method support both of these?

Thanks! :D
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Mon Jan 11, 2010 7:09 pm    Post subject: Reply with quote

Moriah wrote:
I have been using gentoo-sources for 6 years now. I am working on my first gentoo laptop install, details are at:

https://forums.gentoo.org/viewtopic-t-809431-postdays-0-postorder-asc-start-0.html

I am wondering if I still need to use suspend2-sources to use your method.

I also plan to eventually go with RAID-1 as well as LVM2 on the root filesystem, but for now I am just using a simple 320 GB drive. Since I have 8 GB, it is usually easier to sleep than to hibernate. Does your method support both of these?

Thanks! :D


suspend2 has become tuxonice, so if you wanted to use it you could use tuxonice. As to NEED, no use whatever works for you. The tuxonice stuff allows suspend to work well, I have not tried with other kernels.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
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