LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 06-23-2008, 08:01 PM   #1
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
/boot LVM


I've created LVM on my laptop

sda1 /boot (for lvm system)
sda2 lvm
sda3 lvm
sda4 extended
sda5 swap
sda6 centos
sda7 fedora

1.Gradually I will add the physical partitions to LVM. Is it necessary to keep /boot on a physical partition? (That's what I read somewhere)

2. Also, I've been reading about RAID. Is it possible to include a NAS to a RAID array? At the moment my NAS works as an ftp server. If it is possible, would it make any sense in terms of file access/write speed (when compared to local drives)?

3. I just want to confirm: there's no way I could convert sda6 and sda7 to LVM without losing the data on them, is there?
Can I copy those partitions to LVM space?

thanks
 
Old 06-24-2008, 01:19 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,571
Blog Entries: 13

Rep: Reputation: 182Reputation: 182
(1) Far as I know, boot has to be on a partition lilo or grub can read, which doesn't include LVM, yet

(2) Interesting idea, I'm sure you could get mdadm to include (almost)anything on a RAID set, but I think you'd better allow for delay times on reads and writes. I'm thinking this is not a great idea though, if it's a backup plan. As I'm sure you know, RAID is not backup. But it might be fun.

(3) I don't see why you couldn't mount the LVM partitions as well as the other partitions separately and copy over whatever you want, including the whole file system, then add them to LVM. Of course you might be space constrained and have to use your backup. But maybe I'm not understanding the question.
 
Old 06-24-2008, 01:36 PM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Original Poster
Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
Quote:
(3) I don't see why you couldn't mount the LVM partitions as well as the other partitions separately and copy over whatever you want, including the whole file system, then add them to LVM. Of course you might be space constrained and have to use your backup. But maybe I'm not understanding the question.
So, I could copy my fedora on sda7 to a newly created logical volume. The only thing I'd have to do is to update grub entries.

thanks
 
Old 06-25-2008, 04:41 AM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Original Poster
Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
hmmm,

I created new LVs in my VG and copied partitions 6 and 7 (fedora, centos) onto them. Now I've got a problem because I don't know how to update grub.

sda1 /boot (for lvm system)
sda2 pv1 \
sda3 pv2 | vg
sda4 pv3 /

My vg consists of:

Quote:
vol1 / centos1 (with /boot partition outside lvm)
vol2 /usr centos1
vol3 /var centos1
vol5 /tmp centos1
vol4 /home centos1
vol5 swap
vol6 / fedora (the whole system on one partition - copied from sda6)
vol7 / centos2 (the whole system on one partition - copied from sda7)
free space ( used to be sda6 and 7)
Now I'm trying to update the grub on centos1 with no luck. Is there any way to boot fedora and centos2 or does EACH system have to have /boot partition outside LVM?

thanks

Last edited by sycamorex; 06-25-2008 at 04:43 AM.
 
Old 06-25-2008, 12:28 PM   #5
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,571
Blog Entries: 13

Rep: Reputation: 182Reputation: 182
I apologize; I did not realize you wanted to multiboot off of one LVM system. Interesting, but I don't see why you can't make it work.

I wouldn't think you'd have to reinstall grub, just change the menu.ls

I think that the different distros could share a /boot partition, if you are very careful that their boot files such as the kernel and initrd are not over written by each other. So they'll each need a different name, like vmlinuz-centos, vmlinuz-fedora, initrd-fedora etc. then I'd setup menu.lst with a different entry for each with a different specification of root=/dev/whatever the approprate volume name is.

You might need to remake the initrds for each of the distros to make sure that LVM is started appropriately. I'm out of my depth on that one, as each distro seems to load its file system differently and allow modification of its initrd differently.

Last edited by mostlyharmless; 06-25-2008 at 12:30 PM.
 
Old 06-25-2008, 05:03 PM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Original Poster
Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
No worries - it's not a critical server of Google so a bit of breaking the system won't do much harm

This is my menu.lst:
Code:
title CentOS (2.6.18-92.1.1.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-92.1.1.el5 ro root=/dev/xtdgroup/lv1root rhgb quiet noapic
        initrd /initrd-2.6.18-92.1.1.el5.img
title   Fedora 9 
        root (hd0,1)
        kernel /boot/vmlinuz-2.6.25.6-55.fc9.i686 ro root=/dev/xtdgroup/lv8_fedora rhgb quiet
        initrd /boot/initrd-2.6.25.6-55.fc9.i686.img

title CentOS2 (2.6.18-53.1.21.el5xen)
        root (hd0,1)
        kernel /boot/xen.gz-2.6.18-53.1.21.el5
        module /boot/vmlinuz-2.6.18-53.1.21.el5xen ro root=/dev/xtd8865/lv7_centos2 rhgb quiet noapic
        module /boot/initrd-2.6.18-53.1.21.el5xen.img

The first instance of Centos works (that's the one with /boot outside of lvm)

In F9 and Centos2 I agree that:
Code:
root (hd0,1)
will return an error.
As you said, I'd have to share the /boot partition, however, what exactly would I have to do? Copy the files from fedora /boot to /boot on the first partition? (Obviously making sure that the names of the files are not overlapping). I don't really understand how it would work.

any help
thanks
 
Old 06-26-2008, 12:27 PM   #7
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,571
Blog Entries: 13

Rep: Reputation: 182Reputation: 182
Here's what I was thinking:

You copy over the files over to the /boot partition without the names overlapping. The menu.lst changes so that all of the entries have root(hd0,0); as I'm sure you know grub's "root" is just the place where it finds the kernel, and has nothing to do with the root file system.

The hard part is modifying the initrd of the non-LVM aware distros Fedora 9 and CentOS2; I would imagine that the initrd in your original CentOS sets up the LVM, finds the volumes and mounts them appropriately (/ on vol1 of the LVM, /boot on /dev/sda1 /usr on vol2 etc.). You will have to modify the other two initrds to do the same; ie. mount / on vol6 and vol7, respectively with /boot on /dev/sda1. I (kindof)know how to do that for Slackware, but I'm not familiar with the differences for the other two distros. If nothing else, I remember reading somewhere that there is a way to mount the cpio archive initrd.gz as a file system using the loop device, modifying it, and saving it, which might be easier than trying to rebuild it without the native OSes up and running.
 
Old 06-30-2008, 08:19 AM   #8
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Original Poster
Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
thanks, however I messed it up big time I couldn't boot any of the systems. Although it was recoverable, I decided to sort out my laptop and perform fresh installations. As I upload every new file (docs, music, etc) to my NAS on a daily basis, I did not have any problem with data loss.
regards
sycamorex
 
Old 06-30-2008, 08:33 AM   #9
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can I ask why you want to do this? You are probably going to have all sorts of fun when you do an update, and what's the benefit - a few fewer partitions?

The real benefit of LVM is that you can add new physical volumes in to a logical partition - ie increase a filesystem without additional mount points. You seem to be doing the opposite.

How many physical volumes are behind what you are doing?
 
Old 06-30-2008, 10:13 AM   #10
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Original Poster
Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
I've already started the installation - it's my laptop - so I'm not likely to add any additional drives. However, as I appreciate the benefits of lvm, what I'm planning to do is to backup my main box and change the partition system to lvm (it makes much more sense on the main computer where I have a few drives)

thanks
 
Old 06-30-2008, 10:22 AM   #11
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Original Poster
Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
Actually, I've got a question regarding installing new systems on lvm.
Provided that I have one /boot partition, I can then create LVM and install some distros (I'll mount /boot on the /boot without formatting the filesystem on /boot so that the files from different distros could coexist - the kernel files will probably not clash as centos 5.1, fedora 9, slackware 12.1 use different kernels 2.6.18, 2.6.25, 2.6.21 respectively. Is it going to work?
 
Old 06-30-2008, 11:29 AM   #12
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,571
Blog Entries: 13

Rep: Reputation: 182Reputation: 182
Well, it's like billymayday implied, the purpose of LVM, usually, is to combine physical volumes into a single filesystem without additional mount points. When you're installing different distros, you really want to keep their file systems separate. So while I don't think it'd be impossible to do what you plan, it might not be the best thing to try. Really, LVM isn't the issue here; the question is - can you install several distros on one file system and hide each of them from each other.
 
Old 06-30-2008, 11:34 AM   #13
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,613
Blog Entries: 1

Original Poster
Rep: Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047Reputation: 1047
Quote:
So while I don't think it'd be impossible to do what you plan, it might not be the best thing to try. Really, LVM isn't the issue here
So provided that I can start from scratch. What would be better for a computer with say 4 distros - physical partitions or lvm?
 
Old 06-30-2008, 12:23 PM   #14
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,571
Blog Entries: 13

Rep: Reputation: 182Reputation: 182
My vote: 4 distros = 4 partitions or more. If you want LVM for something else (say, LUKS encryption), each distro can do LVM on its own partition. Basically I'd treat each distro as its own OS, just as if you were installing Microsoft Windows and BSD and Solaris....
 
Old 06-30-2008, 05:14 PM   #15
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
It also means if you have a filesystem problem, you don't lose all your distros if /boot get corrpted, etc.

I can't see a lot of advantages in LVM for what you are doing, and it's just harder to administer and a (minor) extra potential point of failure
 
  


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
how can i turn off LVM so it's not there at boot DarkPlexus Linux - Newbie 3 11-18-2007 05:14 AM
Resize lvm and move /boot? tgm4883 Fedora 1 08-22-2006 08:46 PM
Can't boot, LVM and inode problem Raoul68 Linux - General 2 11-01-2005 02:34 PM
Can't boot, LVM and inode problem Raoul68 Linux - Hardware 0 10-30-2005 04:14 AM
activating LVM at boot time NGraphiX Linux - General 2 05-22-2003 06:37 AM


All times are GMT -5. The time now is 03:22 AM.

Main Menu
Advertisement
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