Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fresh setup with efi boot, grub2, lvm, encrypted volumes etc
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
CrUpf
n00b
n00b


Joined: 13 Dec 2008
Posts: 12
Location: /home/crupf

PostPosted: Sat Aug 17, 2013 2:56 pm    Post subject: Fresh setup with efi boot, grub2, lvm, encrypted volumes etc Reply with quote

Hello everybody,

my laptop's display gonna broke ~ a year ago. Since I didn't really need it, I didn't replace it until now. Gentoo is already running on it (right now) but the software is really old. It would need the gcc 4.6 upgrade, the udev upgrade, it would need the portage upgrade - which didn't work at the first try, I didn't bother to try again - I couldn't even install ntfs3g because fuse is masked which it is because portage is too old and the list goes on. Not to speak about drivers, kernel upgrades etc.

So I already decided to make a new fresh installation. I can save various configs etc. to dropbox/pastebin/whatever.

All my previous gentoo installations were rather easy:

100-400 MB ext2 /boot
something >40 GB ext3 or ext4 /
something like 4GB swap
the rest to /home, also ext3 or ext4
(I need a lot of /home space)

It works. It's not that efficient.
Since I have a lot of free time to make it better in the next 3 weeks, I want to try something more complicated.

First, it is a laptop. I can forget it in the university, it can get stolen or whatever. I want encryption. At least an encrypted /home but I've read it would be useful to encrypt everything, since it adds more complications for other people trying to crack it. But there are exceptions: Resource critical applications, let's say games, shouldn't be encrypted. Actually I don't want /usr, /opt and the wine directory to be encrypt.

Then there are other performance tweaks I could do:
- put /usr/portage on a 1024 block sized ext2 partition
- put /usr/portage/distfiles and /usr/portage/packages on a 4096 block sized ext2. I want them on one partition mounted at /var/portage maybe or /opt/portage or /mnt/portage and make symlinks from /usr/portage to the respective subdirectories.
- putting some /tmp subdirs on a tmpfs (or shm?). That shouldn't use more than 300mb RAM, so I want portage (compiling stuff) to be excluded.

For all of this, lvm2 would be very useful.
So I would need an initramfs too.

I've read about dracut and here is my first actual question:
In the wiki it says the created initramfs image would be based on the currently active kernel. Would that mean, that I already have to have booted the respective kernel on the lvm/encrypted system that I would want to boot with the initramfs that I create? Isn't this a chicken vs egg problem?
Or could I use dracut out of a chrooted environment while installing?

Then there is EFI...

I've read that grub2 supports booting a lvm target and an encryted target and already supports being booted on an EFI system. Doesn't that mean, that I wouldn't need an initramfs?

My laptop supports (U)EFI. Actually as i did a more classical installation last time, I've installed grub (legacy) in the MBR. It works. I didn't even thought about EFI last time.
Actually as I need an additional, physical FAT32 partition to boot using efi, isn't this actually inferior to using the (hybrid) MBR?

I am really, really confused and reading the various wikis a 4th time etc. doesn't help me here. I would be very grateful for a bit clarification. Sorry for my bad english too.

Also some information on my hardware:
It's an ASUS X53U, with an AMD Brazos E-450 dual core, 1650 Mhz. A 320GB sata drive. 4GB DDR3 RAM at 1333 Mhz, 512MB is used by the GPU (Radeon HD 6320).
Kernel processer family currently is Generic x86_64 - is there a better alternative?
GCC settings currently are -march=amdfam10 but will be -march=btver1 and -mtune=btver1 with gcc 4.6.
I currently use the open source radeon driver with kernel modesetting enabled and with framebuffer support, it works like a charm, but I want to use the AMD drivers for the sake of better 3D acceleration.
I also use tuxonice and really want to use that again. I think there is no problem with using lvm etc.

Greetings!
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sat Aug 17, 2013 6:11 pm    Post subject: Reply with quote

uefi/gpt:For booting an uncomplicated single os, https://wiki.gentoo.org/wiki/EFI_stub_kernel is outstanding. Note that If used with lvm2 and encryption, the initramfs as well as the kernel command line must be built in.
If you want a boot manager, legacy grub now works on gpt disks and is simpler, better documented, and more reliable than grub2.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sat Aug 17, 2013 6:20 pm    Post subject: Reply with quote

duped
_________________
Defund the FCC.


Last edited by DONAHUE on Sun Aug 18, 2013 12:07 am; edited 1 time in total
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sat Aug 17, 2013 9:03 pm    Post subject: Re: Fresh setup with efi boot, grub2, lvm, encrypted volumes Reply with quote

CrUpf wrote:
My laptop supports (U)EFI. Actually as i did a more classical installation last time, I've installed grub (legacy) in the MBR. It works. I didn't even thought about EFI last time.


If you're setting up a Linux-only computer (without dual-booting to Windows), you can ignore the EFI features (aside from ensuring that CSM/BIOS/legacy support is enabled in the firmware) and boot in CSM/BIOS/legacy mode if you like. This is likely to be the path of least resistance for you, since it means no EFI learning curve. OTOH, you'll need to learn about EFI sooner or later, and EFI-mode booting has some small advantages today (such as a slightly quicker boot on some systems) and is likely to have more advantages in the future.

Quote:
Actually as I need an additional, physical FAT32 partition to boot using efi, isn't this actually inferior to using the (hybrid) MBR?


It's certainly not inferior to using a hybrid MBR, which is a Frankenstein monster of a partitioning system in which a legal GPT data structure is modified to shoehorn in up to three MBR partitions. On a Linux-only installation, the MBR partitions will be ignored, so you'll have no benefit from a hybrid MBR; but hybrid MBRs are ugly and dangerous, so you'll be left with an accident waiting to happen. The main use of a hybrid MBR is on Macs that dual-boot with Windows in BIOS mode. Windows sees the MBR side, which is required to get Windows to boot in BIOS mode; but OS X sees the GPT side, which it prefers.

I suspect you're really wondering whether booting in EFI mode (with GPT partitions) or BIOS mode (with MBR partitions) is preferable, though. An EFI-mode boot does require an unencrypted FAT32 EFI System Partition (ESP), but that partition holds the boot loader (GRUB, ELILO, rEFInd, or whatever) and not much else. I'm not an expert on Linux disk encryption, but I don't think the boot loader is encrypted even in a BIOS-mode boot; it's just that GRUB resides mostly in unallocated parts of the disk on a BIOS system. This is actually a drawback to a BIOS-mode boot compared to an EFI-mode boot, since it's easier to manage the GRUB installation under EFI. (In theory; in practice, there are a number of EFI bugs that can cause problems, particularly if you're unlucky enough to get a bad EFI implementation.)

Note that it's possible to boot Linux in BIOS/CSM/legacy mode from a GPT disk. Doing this requires adding a small (1-2MiB) BIOS Boot Partition to the disk to hold the parts of GRUB that reside in unallocated areas under MBR.

One more point: When booting in EFI mode, it's sometimes desirable or even necessary to store the Linux kernel on the ESP, or perhaps on an unencrypted /boot partition. I doubt if this would make the system any less secure, but as I said, I'm not an expert on Linux disk encryption, so I could be wrong about this. It's my understanding that GRUB can handle encrypted filesystems and therefore should be able to read the kernel from an encrypted partition; but if you want to give yourself some options in the boot loader arena, you might want to leave yourself the option of putting your kernel and initrd on an unencrypted ESP or /boot partition. This will let you use rEFInd, gummiboot, ELILO, or other boot managers and boot loaders that can't read the kernel from an encrypted filesystem.

Quote:
It's an ASUS X53U, with an AMD Brazos E-450 dual core, 1650 Mhz. A 320GB sata drive. 4GB DDR3 RAM at 1333 Mhz, 512MB is used by the GPU (Radeon HD 6320).
Kernel processer family currently is Generic x86_64 - is there a better alternative?


There is the Opteron/Athlon64/Hammer/K8 option. As a practical matter, I doubt if it would improve performance much, but if you don't anticipate switching to an Intel chip any time soon, you might as well use it for whatever modest benefits it provides.
Back to top
View user's profile Send private message
CrUpf
n00b
n00b


Joined: 13 Dec 2008
Posts: 12
Location: /home/crupf

PostPosted: Sat Aug 24, 2013 10:07 pm    Post subject: Reply with quote

Thank you for the replies so far.

I've tried much now.

Actually I want the EFI learning curve. I am thinking of repairing systems and networks for end users for money. I could do it for home users. I've already built up the networks in my school, in another college etc.
So I will have to understand EFI anyways.

I've found out that my ASUS X53U has a very good UEFI implementation. The boot menu did automatically add new entries for all my FAT32 usb sticks that I've tested, even a windows 7 dvd iso converted to be run from usb.
It also automatically boots a GPT formatted disk with the correct directory structure and bootx64.efi in the correct location on the ESP. It is also quite easy to manually add a new entry in the UEFI BIOS for booting another location (ex. an EFI stub kernel etc.). However, it seems that my laptop doesn't support UEFI secure boot. I didn't find a corresponding option in the bios.

I'm also now aware of the differences of BIOS/MBR, BIOS/GPT, UEFI/GPT, and GPT/MBR hybrid differences. I was confused at first.



However, there are more problems:

Now that I've successfully installed GRUB2 on my ESP, my GRUB2 shows no menu, but the shell only. Google returns, there are options, that hides the menu, but disabling these options doesn't work. As the GRUB2 configuration on other distros is quite different, I couldn't fix it yet.
However, I am actually able to boot my kernel manually.

I want to use fglrx. Fglrx disables other framebuffer devices while running. I don't have it installed yet, therefore it doesn't matter for now.

As I am booting using GRUB2 on EFI, I have to use the efi framebuffer included in the kernel. But it doesn't work.

When I boot my kernel, GRUB2 warns me about missing video modes and then then the screen freezes. As my hdd led is blinking for a few seconds, I think the kernel boots correctly but just doesn't print any output as efi fb doesn't start.
So I either have to research on that matter or anyone can help me here? Afaik I cannot throw all fbs away and just fall back to the good old 640x480 vga screen as there is no such thing when booting from efi. I could use it, if I convert my ESP to an EFI grub bios partition and just boot BIOS/GPT (and then reinstall grub2 with pc target instead x86_64-efi)

-------
my opinion about GRUB2 for now:
support for uefiI, gpt, dm-crypt, lvm etc. is working like a charm. the config tool is bulls***. the scripts are totally useless (to me). the config file is bloated (thousands of options, 10 din a4 pages when printed), and in my case the default automatic configuration doesn't even work.
the bash like shall on the other hand is very nice.



-----

I have another problem. Actually it is no problem because I have solved all relating problems, but the problem is, it did cost me 2 hours of time.

I want to use systemd.

As gentoo uses openrc by default, the transition is complicated. I had to manually emerge dbus and polkit Imaybe more packages) with various use flags disabled, then emerge systemd with even more (default) useflags disabled just to reemerge dbus and polkit with 1 more use flag, then reemerge alot of packages due to -openrc and +systemd. And i always have to disable the x, cairo, gtk, qt4, cups and related use flags or otherwise any package depending on systemd calls for 500mb of sources and 4325435zillion packages as systemd calls for a complete X11 by default. Really, I don't want such things on a fresh installation when I don't have a bootloader or the kernel even downloaded. I want my init system running asap.




I am thinking of various choices now:

Switch to another bootloader that is easier to config, ex syslinux derivatives? But actually I want to use the EFI/GPT boot and not BIOS/GPT... maybe rEFInd, but that would mean new stuff to learn...
Switch to Arch Linux, as GRUB2 and systemd are distro defaults there? But I want portage! (for the sake of optimized compiling and use flags)


thanks for reading, even though it sounds like whining and not like actual questions. greetings
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sat Aug 24, 2013 11:27 pm    Post subject: Reply with quote

neither status nor questions are clear to me. suggest you go for one problem at a time.

rEFInd and efi_stub is a beautiful combination of bootmanager and bootloader.

if/when the boot screen goes black try raising the back light with
Quote:
Fn+F1 Suspend switch
Fn+F2 WLAN switch
Fn+F3 Keyboard light down
Fn+F4 Keyboard light up
Fn+F5 Brightness down
Fn+F6 Brightness up
Fn+F7 LCD on/off
Fn+F8 LCD/CRT switch display
Fn+F9 TouchPad Lock
Fn+F10 Volume on/mute
Fn+F11 Volume down
Fn+F12 Volume up
Fn+Ins Numeric Key Pad on/off
Fn+Num Lk: Scroll Lock on/off
Fn+Del Scroll Lock on/off
Fn+Space Power 4Gear
Fn+C Splendid
Fn+V: Life Frame
If the screen becomes readable see https://forums.gentoo.org/viewtopic-t-968136-highlight-i915+black+boot.html for a continuing fix.

The fglrx kernel config should be.
Quote:
Device Drivers --->
Graphics support --->
<M> /dev/agpgart (AGP Support) --->
--- /dev/agpgart (AGP Support)
<M> AMD Opteron/Athlon64 on-CPU GART support
< > Intel 440LX/BX/GX, I8xx and E7x05 chipset support
< > SiS chipset support
< > VIA chipset support
-*- VGA Arbitration
(2) Maximum number of GPUs
[ ] Laptop Hybrid Graphics - GPU switching support
< > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
<*> Lowlevel video output switch controls
<*> Support for frame buffer devices --->
--- Support for frame buffer devices
[*] Enable firmware EDID
[ ] Framebuffer foreign endianness support --->
[*] Enable Video Mode Handling Helpers
[*] Enable Tile Blitting Support
*** Frame buffer hardware drivers ***
< > Cirrus Logic support
< > Permedia2 support
< > CyberPro 2000/2010/5000 support
< > Arc Monochrome LCD board support
[ ] Asiliant (Chips) 69000 display support
[ ] IMS Twin Turbo display support
< > VGA 16-color graphics support
< > Userspace VESA VGA graphics support
[ ] VESA VGA graphics support
[*] EFI-based Framebuffer Support
< > N411 Apollo/Hecuba devkit support
< > Hercules mono graphics support
< > Epson S1D13XXX framebuffer support
< > nVidia Framebuffer Support
< > nVidia Riva support
< > Intel740 support
< > Intel LE80578 (Vermilion) support
< > Matrox acceleration
< > ATI Radeon display support
< > ATI Rage128 display support
< > ATI Mach64 display support
< > S3 Trio/Virge support
< > S3 Savage support
< > SiS/XGI display support
< > VIA UniChrome (Pro) and Chrome9 display support
< > NeoMagic display support
< > IMG Kyro support
< > 3Dfx Banshee/Voodoo3/Voodoo5 display support
< > 3Dfx Voodoo Graphics (sst1) support
< > VIA VT8623 support
< > Trident/CyberXXX/CyberBlade support
< > ARK 2000PV support
< > Permedia3 support
< > Fujitsu carmine frame buffer support
[ ] AMD Geode family framebuffer support
< > SMSC UFX6000/7000 USB Framebuffer support
< > Displaylink USB Framebuffer support
< > Goldfish Framebuffer
< > Virtual Frame Buffer support (ONLY FOR TESTING!)
< > E-Ink Metronome/8track controller support
< > Fujitsu MB862xx GDC support
< > E-Ink Broadsheet/Epson S1D13521 controller support
< > AUO-K190X EPD controller support
[ ] Exynos Video driver support --->
[*] Backlight & LCD device support --->
--- Backlight & LCD device support
<*> Lowlevel LCD controls
< > Platform LCD controls
<*> Lowlevel Backlight controls
< > Generic (aka Sharp Corgi) Backlight Driver
< > Apple Backlight Driver
< > Tabletkiosk Sahara Touch-iT Backlight Driver
< > Backlight Driver for ADP8860/ADP8861/ADP8863 using WLED
< > Backlight Driver for ADP8870 using WLED
< > Backlight Driver for LM3630
< > Backlight Driver for LM3639
< > Backlight driver for TI LP855X
Console display driver support --->
-*- VGA text console
[*] Enable Scrollback Buffer in System RAM
(256) Scrollback Buffer Size (in KB)
<*> Framebuffer Console support
[ ] Map the console to the primary display device
[ ] Framebuffer Console Rotation
[ ] Select compiled-in fonts
[*] Bootup logo --->
--- Bootup logo
[ ] Standard black and white Linux logo
[ ] Standard 16-color Linux logo
[*] Standard 224-color Linux logo
/etc/portage/make.conf should contain VIDEO_CARDS="fglrx" and INPUT_DEVICES="evdev synaptics" .
add x11-drivers/ati-drivers ~amd64 to /etc/portage/package.keywords.
Code:
emerge linux-firmware ati-drivers xf86-input-evdev xf86-input-synaptics xorg-server twm xterm xclock
ati-config --initial
reboot

http://www.areyoueye.net/scripts/watermark_nix.sh provides a script to remove the beta watermark.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sun Aug 25, 2013 12:22 am    Post subject: Reply with quote

CrUpf wrote:
I've found out that my ASUS X53U has a very good UEFI implementation.


ASUS seems a little better than average on this score.

Quote:
However, it seems that my laptop doesn't support UEFI secure boot. I didn't find a corresponding option in the bios.


If it's a new laptop, this is surprising. If it comes with Windows 8, the lack of Secure Boot options is very surprising. My own ASUS motherboard labels its Secure Boot options strangely -- it's "OS Type," with options of "Windows 8 UEFI" and "Other." If you select "Windows 8 UEFI," Secure Boot will be enabled, and additional Secure Boot options appear.

Quote:
Now that I've successfully installed GRUB2 on my ESP, my GRUB2 shows no menu, but the shell only.


My own approach to GRUB problems has been to improve rEFIt into rEFInd. I think that should say something about the depth of my displeasure with GRUB 2 on EFI.

Quote:
I want to use fglrx. Fglrx disables other framebuffer devices while running. I don't have it installed yet, therefore it doesn't matter for now.


It might, since you seem to be having framebuffer problems, as you relate later. You may need to find a "magic combination" of built-in (or loaded) kernel modules and kernel command-line options to get video working. This has become more and more of a problem in recent years, and it's gotten worse with EFI. (Some EFIs don't seem to initialize video hardware in the way the kernel expects; or maybe it's new video hardware that's come out at the same time as the transition to EFI.)

Quote:
As I am booting using GRUB2 on EFI, I have to use the efi framebuffer included in the kernel. But it doesn't work.


This isn't really a GRUB issue. EFI provides a framebuffer device, and if you boot in EFI mode, the kernel will normally use that device for its console output, at least initially. Later in the boot process, the computer may switch to another framebuffer device for console output. As I wrote earlier, you may need to look for some combination of kernel modules and command-line options to get it to work.

Quote:
When I boot my kernel, GRUB2 warns me about missing video modes and then then the screen freezes. As my hdd led is blinking for a few seconds, I think the kernel boots correctly but just doesn't print any output as efi fb doesn't start.


If you can boot in some other way (including booting from an emergency disc and chrooting in), you should be able to set up an SSH server, which should then enable you to access the computer from another system. That should help with your debugging.

Quote:
I could use it, if I convert my ESP to an EFI grub bios partition and just boot BIOS/GPT (and then reinstall grub2 with pc target instead x86_64-efi)


You can carve off 1-2MiB from any partition for a BIOS Boot Partition ("grub_bios" flag in parted) and have both boot loaders installed at once. OTOH, keeping BIOS-mode and EFI-mode copies of GRUB 2 disentangled can be tricky. Instead, you might want to install SYSLINUX in BIOS mode or abandon GRUB in EFI mode in favor of rEFInd or gummiboot with the EFI stub loader.

Quote:
Switch to another bootloader that is easier to config, ex syslinux derivatives? But actually I want to use the EFI/GPT boot and not BIOS/GPT... maybe rEFInd, but that would mean new stuff to learn...


The SYSLINUX version for EFI is pretty new. It's worked for me, by my testing has been minimal. As I'm rEFInd's maintainer, I'm partial to it. Its configuration file format is quite simple compared to GRUB's. In fact, refind.conf will probably work reasonably well for Linux with just one line:

Code:
scan_all_linux_kernels


Most of the lines in the sample file are comments that document the file's format. You may also need to install an EFI driver for whatever filesystem you use on /boot (or /, if /boot isn't separate). That's just a matter of copying the relevant file to the "drivers" subdirectory of rEFInd's installation directory. (If you use install.sh to set up rEFInd, it should do this automatically.)

Used in this minimalistic way, you may need a /boot/refind_linux.conf file to hold your kernel options. The install.sh script that comes with the program should generate this file automatically, and then you can tweak it as needed.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sun Aug 25, 2013 12:44 am    Post subject: Reply with quote

x53u shipped with win7 starting mid 2011, secure boot unlikely?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sun Aug 25, 2013 1:39 am    Post subject: Reply with quote

DONAHUE wrote:
x53u shipped with win7 starting mid 2011, secure boot unlikely?


If it's from 2011, then yes, Secure Boot would likely not be included in the firmware. (It's conceivable there's a firmware update that supports Secure Boot, though.) Secure Boot first started to become common around the time Windows 8 was released, in mid-to-late 2012.
Back to top
View user's profile Send private message
CrUpf
n00b
n00b


Joined: 13 Dec 2008
Posts: 12
Location: /home/crupf

PostPosted: Sun Aug 25, 2013 9:49 am    Post subject: Reply with quote

Yes, it was delivered with Win7. I've never booted Win7 though 8-). I've bought it in the beginning of 2012. So, no "secure" boot. But that's a plus for me.

SSHd is a good idea, thank you. I will test it first. If working, I might tinker with the kernel and framebuffers, but if not, I might just switch to BIOS/GPT to be able to use the vga 640x480 display...
Results will be posted later.
Back to top
View user's profile Send private message
CrUpf
n00b
n00b


Joined: 13 Dec 2008
Posts: 12
Location: /home/crupf

PostPosted: Sun Aug 25, 2013 12:47 pm    Post subject: Reply with quote

Oh my.. I've just put the generated grub.conf in the wrong directory.
One has to do
Code:
# grub2-mkconfig -o <boot-directory>/grub2/grub.conf

Or in my case it is "GRUB2" as I've created the directory through mkdir GRUB2. I've did grub2-install with -boot-directory=/boot/efi

So I also had to put the config in /boot/efi/GRUB2/grub.conf .

Now i have a working GRUB2 boot menu, and if I select the Kernel, the corresponding initrd/initramfs gets loaded, but now, I have a kernel (or initramfs?) rescue shell.
There is an error "/dev/mapper/vg--main-root/ is not a valid root directory. [or 'partition', can't remember exactly]".
I've checked the /dev/ directory. There is a mapper subdir, but that doesn't contain VGs/LVs. There is no /dev/vg-main/ directory either.

So I guess either LVM doesn't read my VGs/LVs from the disk or doesn't get loaded correctly in the initramfs.

I did
Code:
genkernel --lvm --install initramfs --kernel-config=/usr/src/linux/.config

and it correctly loaded my tuxonice-3.8.13 config file from there.



Oh, and the GRUB2 video modes magically worked with the correct config file and the efi fb did too as the kernel/initramfs booted.



------ EDIT: ------

My error message is the same like in http://forums-web1.gentoo.org/viewtopic-t-948452-start-0.html and https://forums.gentoo.org/viewtopic-t-813229-start-0.html
but in the rescue shell there are the correct drives under /dev/sd*. So it has to be related to lvm.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sun Aug 25, 2013 2:56 pm    Post subject: Reply with quote

Did you remember the "dolvm" kernel option? That's required to use LVM with Gentoo and an initramfs.
Back to top
View user's profile Send private message
CrUpf
n00b
n00b


Joined: 13 Dec 2008
Posts: 12
Location: /home/crupf

PostPosted: Sun Aug 25, 2013 3:13 pm    Post subject: Reply with quote

Actually yes. I did:
Code:
GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd dolvm"

But for some reason, in my GRUB2 menu the dolvm option is not appearing, the systemd option however is.

Now I tried editing it and adding dolvm, successfully - the LVs got activated, but now I have an even more funny error:

Code:
The filesystem mounted at /dev/mapper/vg--main-root does not appear to be valid /, try again


It IS the volume where I installed the stage3, it is the volume that I did mount on /mnt/gentoo and chrooted into for like 20 times.
Is there a way of forcing it?

edit: just trying either /dev/mapper/vg--main-root or /dev/vg-main/root again results in "Device or resource busy"

edit2: It is already mounted on /newroot. Unmounting /newroot through the rescue shell, then skip and therefore retry to mount root results in the same error above (not a valid /) and in the device being mounted on /newroot again.

Might it be related to the fact that I'm trying to have /usr on an extra volume (/dev/mapper/vg--main-usr)?
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sun Aug 25, 2013 9:50 pm    Post subject: Reply with quote

CrUpf wrote:
edit: just trying either /dev/mapper/vg--main-root or /dev/vg-main/root again results in "Device or resource busy"


I notice an inconsistency in dashes in the volume group names you're citing. Specifically, is it "vg-main" or "vg--main"? If you're switching between the two in reality (and not just creating typos in your entries here), that could explain it -- you might have two volume groups with different contents.
Back to top
View user's profile Send private message
CrUpf
n00b
n00b


Joined: 13 Dec 2008
Posts: 12
Location: /home/crupf

PostPosted: Mon Aug 26, 2013 12:23 am    Post subject: Reply with quote

No typo.

I suppose, '-' => '--' and '/' => '-' when using the '/dev/mapper/vg-lv' format instead of '/dev/vg/lv'.
Both paths are working correctly on live systems or chrooted and /dev/mapper/vg--main-root/ is exactly identical to /dev/vg-main/root.




I might start from scratch again and try to avoid - in the vg/lv names...
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Mon Aug 26, 2013 3:06 pm    Post subject: Reply with quote

CrUpf wrote:
No typo.

I suppose, '-' => '--' and '/' => '-' when using the '/dev/mapper/vg-lv' format instead of '/dev/vg/lv'.
Both paths are working correctly on live systems or chrooted and /dev/mapper/vg--main-root/ is exactly identical to /dev/vg-main/root.

I might start from scratch again and try to avoid - in the vg/lv names...


I agree with that plan. When weird things like a doubling-up of "-" in a filename occur, I get suspicious. Alternatively, or at least as a quicker initial test, you could try using "vgrename" to rename your volume group to something that lacks a dash.
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