LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-22-2009, 12:06 AM   #1
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 85

Rep: Reputation: 15
How to have a whole HD LVM (except /boot)


I have two disks in my computer, one of them my main (IDE) drive & a new one (S-ATA). Basically, I want to make the entire sata drive the new primary hard drive, but have it completely under control of the volume manager (except for boot, which I understand has to be on a physical partition). The original (IDE) disk had root and swap as separate, physical partitions. Here's what I've tried:

1. Partition the disk with a 32 meg sda1 and the whole rest of the disk (1 TB total) as sda2.
2. Copy everything from the IDE /boot directory to the sata sda1 (mounted as /target).
3. Set up lvm on the rest of the disk, with logical volumes for root, swap, home, usr, and var.
4. Copy everything from the IDE to the appropriate sata lv's. This is done and everything mounts fine.
5. Mount the sata drive's root lv on /target, the sata boot sda1 on /target/boot, and the other lv's appropriately.
6. Do a chroot to target.
7. Run grub, with the following input:
grub>find /boot/grub/stage1
(hd0,0)
grub>root (hd0,0)
grub>setup (hd0)
grub>quit
This seems to have run with no problem.

What happens is that when I boot, it just hangs, with no output, evidently not even getting to grub. I *think* I may know what's wrong, but am open to any other suggestions.

What I *think* is that none of the above really wrote the MBR (I thought grub would do it, but evidently not). When I check the limits of the partitions, it appears that sda1 starts on cylinder #1, but the 63rd sector, so as far as I know (unless grub was supposed to do it), the MBR hasn't been written.

Can someone either a) confirm that this is correct, and/or b) tell me how to get the MBR correctly written (preferably the "and" condition;-).

TIA
anw
 
Old 02-22-2009, 12:28 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,125

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Did you pull the IDE out prior to re-boot by any chance ?.
 
Old 02-22-2009, 10:30 AM   #3
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 15
No, I wanted to have both disks in there at the end of the day. In the bios, I made the sata drive the primary drive, so it's trying to boot from it. When I change the primary drive to the IDE, it boots from it fine, just as always. When the sata is the primary drive, it goes through the normal boot process up to where it would normally display the GRUB menu, then an underscore cursor just sits there on an otherwise blank screen about an inch or two below the top left corner.
 
Old 02-22-2009, 12:12 PM   #4
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Ha! For anyone out there listening, I solved one problem, and got a GRUB boot menu from my sata disk. I used the interactive grub listed in my first post, using hd1 instead of hd0 (I have this in the device.map file, and didn't know what I was doing earlier).

Now, I get the grub menu, but when it goes to boot, I get a "Error 15: file not found", regardless of which menu item I choose. Here they are, from the /boot/grub/menu.lst file:
Quote:
title Debian GNU/Linux, kernel 2.6.26 Using LVM with SATA Disk
root (hd0,0)
kernel /boot/vmlinuz-2.6.26 root=/dev/ram0 lvm2root=/dev/mapper/sda_vol-root
initrd /boot/initrd-lvm2-2.6.26.gz
savedefault

title Debian GNU/Linux, kernel 2.6.26
root (hd0,0)
kernel /boot/vmlinuz-2.6.26 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.26
savedefault
The first one is the one I want to boot. I am going to try changing the "root (hd0,0)" to "root (hd1,0)" and see if that works, but the second line should be my old hard drive, and I get the same message there, which I don't understand.

Also, maybe I should use either (or both) of the:
Quote:
# kopt=root=/dev/sda1 ro
# groot=(hd1,0)
lines in the menu.lst, but they also have the mysterious comment about "## DO NOT UNCOMMENT THEM, Just edit them to your needs", which I don't understand. Are they comments or not?
 
Old 02-22-2009, 03:32 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,125

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Mmmm - Debian; IDE and SATA.
This sounds like a problem I had with Ubuntu. It looks to me like screwed up init scripts, which I was advised go all the way back to the Debian base. The BIOS gives grub a different view of the disk layout than the running system does - cute.
I played around for a while then gave up, however I later saw a comment that using /dev/disk/by-id was a way around it.

Last edited by syg00; 02-22-2009 at 03:47 PM. Reason: typos
 
Old 02-22-2009, 05:44 PM   #6
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Quote:
/dev/disk/by-id
What does this mean?
 
Old 02-22-2009, 09:08 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,125

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Do "ls -l /dev/disk/by-id" and see.
Use the appropriate by-id name in place of /dev/sda1 or whatever. Untried by me, but might fix things.
 
Old 02-23-2009, 09:42 PM   #8
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Hmm! That "by-id" thing is pretty interesting, but I'm not sure how to use it. I've made some further progress- I've moved ahead to where I no longer get the "File not found". I had to go into the device.map and menu.lst to set the hd0 and hd1 to sda and hda, respectively, because I found out the one I boot from is set as hd0, regardless of whether it's the ide or sata drive. I'm now am at the point where I get the boot menu from grub but it appears that when it tries to load the kernel it can't find the right disk driver.

On the other hand, how could it get to the grub menu and start booting linux if that were the case?

What happens is I get a bunch of messages scrolling by, it actually goes into the framebuffer "smaller character" mode, then I get this message:
Quote:
List of all partitions:
0300 488386584 ide driver: ide-disk
0301 29294496 hda1
but it can't seem to see the sata drive.
 
Old 02-23-2009, 10:11 PM   #9
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 15
On second thought, it looks more like it couldn't find whatever lvm driver it needed. Here's a more complete list of the boot messages, appearing right after something about the keyboard:
Quote:
Ramdisk: compressed image found at block 0
List of all partitions:
0300 488386584 hda driver: ide-disk
0301 29294496 hda1
0302 1951897 hda2
0303 457137607 hda3
1600 4590208 hdc driver: ide-cdrom
No filesystem could mount root, tried: ext3 cramfs
Kernel panic- not syncing: VFS: Unaboel to mount root fs on unknown block-block(1,0)
So, I'm thinking right there where it says "No filesystem could mount root, tried: ext3 cramfs", if it had tried the lvm driver it would have succeeded. Any idea how to make it do that?
 
Old 02-28-2009, 10:20 AM   #10
anw
Member
 
Registered: Sep 2003
Location: Florida
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 15
I still haven't gotten this to work. I'm at the place above, where the system boots to saying something about my keyboard, then lists "all partitions", NOT to include the lvm filesystems.

I've fooled with this for the past week, and found a bug in lvm2create_initrd in the way it parsed out the required libraries, fixed it, then found out it was known, so got a later version where it was fixed "officially". That version ran out of space on the ram disk creating links to busybox, so I upped the added space from 512 to 1024, and it ran; however, it still bombs as above when I boot.

The lvm2rescue doesn't work, either, bombing in exactly the same way.

Does anyone know how to tell the boot ramdisk file system that it's got lvm volumes?

Also, supposedly, you can put an "linuxrc" file out on the initrd system. How do you do this? I thought I'd like to execute a shell during the boot process to see what is installed in the initrd (actually, I thought that's what lvm2rescue was supposed to do), but would like to try that from linuxrc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
lvm and multi boot openSauce Linux - General 3 10-27-2008 03:35 PM
/boot LVM sycamorex Linux - Hardware 15 07-02-2008 06:31 AM
how can i turn off LVM so it's not there at boot DarkPlexus Linux - Newbie 3 11-18-2007 04:14 AM
Can't boot, LVM and inode problem Raoul68 Linux - General 2 11-01-2005 01:34 PM
Can't boot, LVM and inode problem Raoul68 Linux - Hardware 0 10-30-2005 03:14 AM


All times are GMT -5. The time now is 08:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration