Author Topic: Moving installation of pclinuxos to new hard drive  (Read 2725 times)

csolomon

  • Guest
Moving installation of pclinuxos to new hard drive
« on: March 13, 2010, 04:07:13 PM »
Hi all-

Newbie here... I installed pclinuxos2009 to a new partition on my primary hard drive.  WinXP is installed on the drive too.  I had a smaller drive that I used to backup my media files in windows, but I bought a new hard drive which is the same size as the original (the one with windows) that I'm now going to use as a backup. I'd like to then use my old backup drive as my linux drive.

Is there anyway to easily copy my linux partition (/ and /swap) to the 2nd drive (I can use the entire drive if I want) without reinstalling?  I would rather avoid reinstalling because I spent several hours configuring and setting up stuff with pclinuxos that wasn't originally working (wireless networking, video card, sound etc).  I'm sure I could manage to just copy all the files, but I don't know how to reconfigure the bootloader (grub).

Hopefully that wasn't too confusing.  Although I'm pretty new to installing and configuring linux, I'm pretty comfortable using the linux cli, so if the easiest way is to use cli programs, then I'm ok with that.

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11599
  • ----IOFLU----
Re: Moving installation of pclinuxos to new hard drive
« Reply #1 on: March 13, 2010, 06:06:01 PM »
Hi all-

Newbie here... I installed pclinuxos2009 to a new partition on my primary hard drive.  WinXP is installed on the drive too.  I had a smaller drive that I used to backup my media files in windows, but I bought a new hard drive which is the same size as the original (the one with windows) that I'm now going to use as a backup. I'd like to then use my old backup drive as my linux drive.

Is there anyway to easily copy my linux partition (/ and /swap) to the 2nd drive (I can use the entire drive if I want) without reinstalling?  I would rather avoid reinstalling because I spent several hours configuring and setting up stuff with pclinuxos that wasn't originally working (wireless networking, video card, sound etc).  I'm sure I could manage to just copy all the files, but I don't know how to reconfigure the bootloader (grub).

Hopefully that wasn't too confusing.  Although I'm pretty new to installing and configuring linux, I'm pretty comfortable using the linux cli, so if the easiest way is to use cli programs, then I'm ok with that.



The copying is easy using rsync. I've given detailed instructions on the forum many times. The same goes for the grub edits, which sometimes are in the same thread with the rsync instructions.

Click the SEARCH button following HOME and HELP buttons at the top of the page, enter rsync under Search for: and old-polack under by user:. Then click the Search button at the bottom.

For each hit, middle click the header directly above the quoted area, before the by old-polack part. This will open the thread, at that particular reply, in a separate tab, so you don't lose your place in the Search Results tab.

Scan the entire thread for the relevant parts on the ones that seem to have long detailed instructions.

This one should give most of what you need. You'll have to make allowances for your partitions having different designations, but the method is simple and complete.

http://www.pclinuxos.com/forum/index.php/topic,60675.msg489237.html#msg489237

You might also want to consider labeling your new partitions, as labels are much easier to understand than UUID numbers, but work the same way, as long as each partitions label is unique. If you are dealing with existing ext3 formatted partitions, as root you can add a label with;

[root@localhost ~]# tune2fs -L <whatever> /dev/<whatever>                     <Enter>

You can also label a swap partition, while it's unmounted, using the mkswap command;

[root@localhost ~]# mkswap -L swap1000 /dev/sdc2                       <Enter>

That's the actual command I used for the swap partition on my 1 TB drive. I use the hard drive size (in GB) to identify each swap partition.

[root@littleboy ~]# blkid |grep swap
/dev/sdb2: LABEL="swap160" UUID="b69ed243-1225-4fc2-be9f-6637c9108391" TYPE="swap"
/dev/sdc2: LABEL="swap1000" UUID="584a1d5d-668d-4435-8a90-589283eb3e8b" TYPE="swap"
/dev/sde2: LABEL="swap750" UUID="0ccd09b0-ebb4-4f78-8c73-632232adf438" TYPE="swap"
/dev/sda2: LABEL="swap200" UUID="438b91c3-6812-40b2-a267-d177415042c5" TYPE="swap"

In your new copy of menu.lst where the UUID of the copied OS shows up in each stanza, you would replace it with root=LABEL=<whatever>, and in the fstab of the copy, the / partition entry would start with;

LABEL=<whatever>   /    ext3     defaults 1 1

Examples:

From my public beta release menu.lst stanza;

title Pbeta-1
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=Pbeta-1 root=LABEL=pbeta1  resume=LABEL=swap1000 splash=verbose vga=791
initrd (hd0,0)/boot/initrd.img


My fstab;

Code: [Select]
# Entry for /dev/sdc14 :
LABEL=pbeta1            /                       ext3    defaults                1 1

LABEL=TR5-Documents     /home/polack/Documents  ext3    defaults                1 2
LABEL=Documents2        /home/polack/Documents2 ext3    defaults                1 2
LABEL=share7            /share7                 ext3    rw,user,noauto,exec     0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec       0 0
LABEL=TV-1              /tv                     ext3    rw,user,noauto,exec     0 0
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec     0 0
none                    /proc                   proc    defaults                0 0
# Entry for /dev/sda2 :
#LABEL=swap200          swap                    swap    defaults                0 0
# Entry for /dev/sdc2 :
LABEL=swap1000          swap                    swap    defaults                0 0
# Entry for /dev/sde2 :
LABEL=swap750           swap                    swap    defaults                0 0
none                    /dev/pts                devpts  mode=0620               0 0
/dev/fd0                /mnt/floppy             auto    rw,user,noauto,exec     0 0
/dev/cdrom              /mnt/cdrom              auto    ro,user,noauto          0 0
/dev/dvd                /mnt/dvd                auto    ro,user,noauto          0 0                                          
/dev/sr1                /mnt/dvd                auto    ro,user,noauto          0 0                                          
none                    /dev/shm                tmpfs   defaults                0 0                                          
« Last Edit: March 13, 2010, 06:07:51 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

csolomon

  • Guest
Re: Moving installation of pclinuxos to new hard drive
« Reply #2 on: March 16, 2010, 03:10:50 PM »
Thanks for the great reply and link to the other post.  I've been reading it thoroughly.  I had a few questions about the info you give here though...



You might also want to consider labeling your new partitions, as labels are much easier to understand than UUID numbers, but work the same way, as long as each partitions label is unique. If you are dealing with existing ext3 formatted partitions, as root you can add a label with;

[root@localhost ~]# tune2fs -L <whatever> /dev/<whatever>                     <Enter>


Where is the label information "stored"?  When you alter/make a label for a partition, where does that info reside?  Inside the partition table itself? 

Quote
In your new copy of menu.lst where the UUID of the copied OS shows up in each stanza, you would replace it with root=LABEL=<whatever>, and in the fstab of the copy, the / partition entry would start with;

LABEL=<whatever>   /    ext3     defaults 1 1

Examples:

From my public beta release menu.lst stanza;

title Pbeta-1
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=Pbeta-1 root=LABEL=pbeta1  resume=LABEL=swap1000 splash=verbose vga=791
initrd (hd0,0)/boot/initrd.img


When I look at my menu.lst file, it looks a little different.  There is no (hd0,0).  Is that strictly necessary? (I presume not, but wonder why you have it, if it isn't)

Regarding your fstab file, that is a pretty cool application of partition labels.  That would prevent the problem of swapping in and out drives and having them be mistakenly assigned the wrong thing (if a new /dev/sda1 is swapped in, for example). 

I'll definitely give that a go.

Is there a really good reference for any of this?  I searched quite extensively around the web for various permutation of the terms "linux, fstab, partition" etc, and most of the documentation I found was old (5+ years) and seemed to be distro specific or not applicable any more.  Is there a really good, up to date reference you'd recommend where I can browse various details like this (without having to pester the forums)?  (And the man pages aren't that much help, nor near as detailed as your post)

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11599
  • ----IOFLU----
Re: Moving installation of pclinuxos to new hard drive
« Reply #3 on: March 16, 2010, 03:46:13 PM »
Thanks for the great reply and link to the other post.  I've been reading it thoroughly.  I had a few questions about the info you give here though...



You might also want to consider labeling your new partitions, as labels are much easier to understand than UUID numbers, but work the same way, as long as each partitions label is unique. If you are dealing with existing ext3 formatted partitions, as root you can add a label with;

[root@localhost ~]# tune2fs -L <whatever> /dev/<whatever>                     <Enter>


Where is the label information "stored"?  When you alter/make a label for a partition, where does that info reside?  Inside the partition table itself? 

Quote
In your new copy of menu.lst where the UUID of the copied OS shows up in each stanza, you would replace it with root=LABEL=<whatever>, and in the fstab of the copy, the / partition entry would start with;

LABEL=<whatever>   /    ext3     defaults 1 1

Examples:

From my public beta release menu.lst stanza;

title Pbeta-1
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=Pbeta-1 root=LABEL=pbeta1  resume=LABEL=swap1000 splash=verbose vga=791
initrd (hd0,0)/boot/initrd.img


When I look at my menu.lst file, it looks a little different.  There is no (hd0,0).  Is that strictly necessary? (I presume not, but wonder why you have it, if it isn't)

Regarding your fstab file, that is a pretty cool application of partition labels.  That would prevent the problem of swapping in and out drives and having them be mistakenly assigned the wrong thing (if a new /dev/sda1 is swapped in, for example). 

I'll definitely give that a go.

Is there a really good reference for any of this?  I searched quite extensively around the web for various permutation of the terms "linux, fstab, partition" etc, and most of the documentation I found was old (5+ years) and seemed to be distro specific or not applicable any more.  Is there a really good, up to date reference you'd recommend where I can browse various details like this (without having to pester the forums)?  (And the man pages aren't that much help, nor near as detailed as your post)

The label information is stored in the filesystem superblock of the partition in question. It doesn't matter where the drive is physically connected on the local machine, mount is looking for a name only. As long as each label is unique, the system will boot it properly.

As far as the menu.lst stanzas are concerned, the (hd0,0) is just the location of the partition holding the kernel. It will be different for different partitions. My Beta 2 installation is on (hd2,12) and the Beta 1 on (hd2,13)

My reference is indeed the man pages. They don't say much because there's not much to say. You're limited to 16 characters. You can use the labels with the mount, and fsck applications. Added to what was already written, that's about all there is.

This is from my terminal as I'm moving things from the beta1 to the beta2 installation.

[root@localhost ~]# mount LABEL=pbeta1 /mnt/here
[root@localhost ~]# ls /mnt/here
bin/         dev/   initrd/      media/          movies/   proc/  share7/  sys/  usr/      zstorage00/
boot/        etc/   lib/         mnt/            movies2/  root/  share9/  tmp/  var/
dead.letter  home/  lost+found/  Module.symvers  opt/      sbin/  swap/    tv/   zbackup/

I needed a quick reference for what mount points I should create at this stage. During the day, I changed kernels four times. The drive was seen as sda, sdb, and sdc, at different times. The partition Labels remained constant.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

csolomon

  • Guest
Re: Moving installation of pclinuxos to new hard drive
« Reply #4 on: March 16, 2010, 06:01:12 PM »


From my public beta release menu.lst stanza;

title Pbeta-1
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=Pbeta-1 root=LABEL=pbeta1  resume=LABEL=swap1000 splash=verbose vga=791
initrd (hd0,0)/boot/initrd.img


What does BOOT_IMAGE= and resume= accomplish?  Looking at the man pages for grub and the online documentation doesn't provide anything useful.

Quote
As far as the menu.lst stanzas are concerned, the (hd0,0) is just the location of the partition holding the kernel. It will be different for different partitions. My Beta 2 installation is on (hd2,12) and the Beta 1 on (hd2,13)

so, if I had to guess, I'd say (hd0,0) means... first hard disk, first partition?  But where is that defined?  Wasn't that the point of making labels, so you wouldn't have to explicitly reference physical locations?

FWIW, my menu.list linux entry is:

title Linux
root (hd0,2)
kernel /boot/vmlinuz root=/dev/sda3 nomce quiet splash vga789
initrd /boot/initrd.img
boot

So it seems like it's unnecessary for the kernel and initrd lines (unless, the "root" line is specifying the location for the entire entry)

« Last Edit: March 16, 2010, 06:06:44 PM by csolomon »

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11599
  • ----IOFLU----
Re: Moving installation of pclinuxos to new hard drive
« Reply #5 on: March 16, 2010, 06:32:27 PM »


From my public beta release menu.lst stanza;

title Pbeta-1
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=Pbeta-1 root=LABEL=pbeta1  resume=LABEL=swap1000 splash=verbose vga=791
initrd (hd0,0)/boot/initrd.img



What does BOOT_IMAGE= and resume= accomplish?  Looking at the man pages for grub and the online documentation doesn't provide anything useful.

I have no Idea why that's there. One can remove it completely and the OS boots without a hiccup.  ???

Quote
Quote
As far as the menu.lst stanzas are concerned, the (hd0,0) is just the location of the partition holding the kernel. It will be different for different partitions. My Beta 2 installation is on (hd2,12) and the Beta 1 on (hd2,13)


so, if I had to guess, I'd say (hd0,0) means... first hard disk, first partition?  But where is that defined?  Wasn't that the point of making labels, so you wouldn't have to explicitly reference physical locations?

FWIW, my menu.list linux entry is:

title Linux
root (hd0,2)
kernel /boot/vmlinuz root=/dev/sda3 nomce quiet splash vga789
initrd /boot/initrd.img
boot

So it seems like it's unnecessary for the kernel and initrd lines (unless, the "root" line is specifying the location for the entire entry)



All you need to know about grub you can get from the konqueror web browser. Start the browser, clear the Location: bar, then type       info:grub     then press the Enter key. Therein lies the official grub manual, with links to navigate to whatever subject one seeks information about.  ;D

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

csolomon

  • Guest
Re: Moving installation of pclinuxos to new hard drive
« Reply #6 on: March 16, 2010, 08:40:15 PM »


All you need to know about grub you can get from the konqueror web browser. Start the browser, clear the Location: bar, then type       info:grub     then press the Enter key. Therein lies the official grub manual, with links to navigate to whatever subject one seeks information about.  ;D


Hey that's a cool trick.  Thanks!  (and to think I was bemoaning the thinness of the grub manpage :)

Offline nerdful1

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1575
  • Registered Linux User #444541
    • Nerdful Things
Re: Moving installation of pclinuxos to new hard drive
« Reply #7 on: March 16, 2010, 10:06:38 PM »
Isn't this moot at the time of the changeover to 2010?

If not for 2010 needing a new install, I'd have told him to make a remaster of the existing system to dvd and install on the new drive.

Good info though.
Promote open source.
Stars up!  Lights Down! Use sky and neighbor friendly outdoor lighting, and save energy.  Darksky dot org.
 ISF Professional that wants to keep black level in the sky.
Mythic Dragon V1.0 Desktop HTPC running PCLOS & Mythtv simultaneously.

csolomon

  • Guest
Re: Moving installation of pclinuxos to new hard drive
« Reply #8 on: March 16, 2010, 10:17:11 PM »
Isn't this moot at the time of the changeover to 2010?

If not for 2010 needing a new install, I'd have told him to make a remaster of the existing system to dvd and install on the new drive.

Good info though.

This is great info. I'm indebted to OP for giving me a veritable tutorial on linux partition management.  Now if I only understood half of it... :)

Offline nerdful1

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1575
  • Registered Linux User #444541
    • Nerdful Things
Re: Moving installation of pclinuxos to new hard drive
« Reply #9 on: March 16, 2010, 10:31:00 PM »
I may pick his brain because as of today, I had tried to Ghost clone a commercial hard drive to file, then to another drive from the file. The system starts with video out just typing grub grub grub endlessly on the screen.

When I look at the clone drive in a pc with a live PCLinuxOS cd, the boot setup does not seem to recognize the partitions, they are blank, but the file manager sees all the stuff in the drive.
Promote open source.
Stars up!  Lights Down! Use sky and neighbor friendly outdoor lighting, and save energy.  Darksky dot org.
 ISF Professional that wants to keep black level in the sky.
Mythic Dragon V1.0 Desktop HTPC running PCLOS & Mythtv simultaneously.

csolomon

  • Guest
Re: Moving installation of pclinuxos to new hard drive
« Reply #10 on: March 17, 2010, 12:16:07 PM »

Scan the entire thread for the relevant parts on the ones that seem to have long detailed instructions.

This one should give most of what you need. You'll have to make allowances for your partitions having different designations, but the method is simple and complete.

http://www.pclinuxos.com/forum/index.php/topic,60675.msg489237.html#msg489237



So I was reading through this post very carefully making sure I understand everything, and something you (or someone else) said in one of the posts gave me a thought...

If I had a spare hard drive (250GB) and I wanted to try out a few different distros to play around with, get experience installing/uninstalling/upgrading etc, I could have several distinct, independent linux installations on that hard drive without them interfering (or even functionally knowing) about each other, right? I assume that involves having at least two (/ and swap) partitions for each. 

Is there a recommended procedure for doing this?  I would be adding this hard drive to a computer that already has WinXP installed on the primary drive, and another linux distro, mepis, installed on a partition of that drive.  If I did this, I guess I could move the mepis installation to the new HD, and add a few more linux installations. 

In this configuration, would grub (or whatever bootloader) be usable to boot all the different OSes?  On that box now, grub manages the WinXP and Mepis booting just fine, but that is on a single HD, so I'm not sure about having multiple OSes on multiple HDs.

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11599
  • ----IOFLU----
Re: Moving installation of pclinuxos to new hard drive
« Reply #11 on: March 17, 2010, 01:10:41 PM »
csolomon:

On my last build of my main computer I had a MB with four dual channel IDE controllers and four SATA controllers, so I could have up to 12 hard drives. The most I ever had was 7, but I had 20+ Linux installations scattered all over them, and booted all of them from a single grub MBR installation. I kept the same grub installation for 4 years, only adding or removing stanzas from /boot/grub/menu.lst when an OS was added or removed.

Presently I have about 12 installations on 4 hard drives on this computer. Grub handles them with ease. This installation is on an external hard drive, booted from the internal hard drive's grub. I don't normally mount any of the partitions holding other OS, unless I want to retrieve a file or something from that specific partition. Only during that mount will the running system be aware of that partition, but not the OS on it. The running system just sees generic data there.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

csolomon

  • Guest
Re: Moving installation of pclinuxos to new hard drive
« Reply #12 on: March 17, 2010, 07:30:04 PM »
csolomon:

On my last build of my main computer I had a MB with four dual channel IDE controllers and four SATA controllers, so I could have up to 12 hard drives. The most I ever had was 7, but I had 20+ Linux installations scattered all over them, and booted all of them from a single grub MBR installation. I kept the same grub installation for 4 years, only adding or removing stanzas from /boot/grub/menu.lst when an OS was added or removed.

Presently I have about 12 installations on 4 hard drives on this computer. Grub handles them with ease. This installation is on an external hard drive, booted from the internal hard drive's grub. I don't normally mount any of the partitions holding other OS, unless I want to retrieve a file or something from that specific partition. Only during that mount will the running system be aware of that partition, but not the OS on it. The running system just sees generic data there.

Whoa, that's crazy.  27! I'm having trouble keeping 3 straight :)

So I installed Arch Linux on the new HD as I described above (/dev/sdb)

I have WinXP on /dev/sda1 and Mepis Linux on /dev/sda2 and /dev/sda3

When Pclinuxos2010 is finalized, I"ll install it on /dev/sdb too.  (As it is, I'm sticking with my 2009 release on my 2nd computer).

So when I installed Arch, I went through a grub configuration, and the last step was doing "boot device selection".  I gathered this was asking where grub should reside.  I selected /dev/sda since that is my primary HD.  (I didn't really understand this part... was grub just wanting to know which hard drive is going to contain the MBR?)

So all is well and working, but I don't understand how grub is reading the configuration files. I mean, I have two of them now:
/dev/sda4/boot/grub/menu.lst (from my Mepis install)
/dev/sdb2/boot/grub/menu.lst (from Arch install)

When I got the chance to edit the grub file before finishing Arch install, I edited it to add the Mepis install info because it wasn't there automatically. 

So now when the computer boots, how does Grub "know" which file to use?  Is there a pointer or something in the MBR on /dev/sda that points to /dev/sdb2/boot/grub/menu.lst? (which IS the one being used)

If I want to change the location of the "valid" grub file, how do I do that?  (like when I install another linux distro on /dev/sdb, I assume I"m going to have 3 grub files then)

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11599
  • ----IOFLU----
Re: Moving installation of pclinuxos to new hard drive
« Reply #13 on: March 18, 2010, 01:37:23 AM »
csolomon:

On my last build of my main computer I had a MB with four dual channel IDE controllers and four SATA controllers, so I could have up to 12 hard drives. The most I ever had was 7, but I had 20+ Linux installations scattered all over them, and booted all of them from a single grub MBR installation. I kept the same grub installation for 4 years, only adding or removing stanzas from /boot/grub/menu.lst when an OS was added or removed.

Presently I have about 12 installations on 4 hard drives on this computer. Grub handles them with ease. This installation is on an external hard drive, booted from the internal hard drive's grub. I don't normally mount any of the partitions holding other OS, unless I want to retrieve a file or something from that specific partition. Only during that mount will the running system be aware of that partition, but not the OS on it. The running system just sees generic data there.

Whoa, that's crazy.  27! I'm having trouble keeping 3 straight :)

So I installed Arch Linux on the new HD as I described above (/dev/sdb)

I have WinXP on /dev/sda1 and Mepis Linux on /dev/sda2 and /dev/sda3

When Pclinuxos2010 is finalized, I"ll install it on /dev/sdb too.  (As it is, I'm sticking with my 2009 release on my 2nd computer).

So when I installed Arch, I went through a grub configuration, and the last step was doing "boot device selection".  I gathered this was asking where grub should reside.  I selected /dev/sda since that is my primary HD.  (I didn't really understand this part... was grub just wanting to know which hard drive is going to contain the MBR?)

Every hard drive has an MBR. By definition it's the first sector of the first cylinder of the hard drive.

Quote
So all is well and working, but I don't understand how grub is reading the configuration files. I mean, I have two of them now:
/dev/sda4/boot/grub/menu.lst (from my Mepis install)
/dev/sdb2/boot/grub/menu.lst (from Arch install)

When I got the chance to edit the grub file before finishing Arch install, I edited it to add the Mepis install info because it wasn't there automatically. 

So now when the computer boots, how does Grub "know" which file to use?  Is there a pointer or something in the MBR on /dev/sda that points to /dev/sdb2/boot/grub/menu.lst? (which IS the one being used)

Yes. The installer tells it which partition is the one with the relevant boot files, so that's where it looks.

Quote
If I want to change the location of the "valid" grub file, how do I do that?  (like when I install another linux distro on /dev/sdb, I assume I"m going to have 3 grub files then)

I install all new installation's grub to the partition's boot sector. Then I add the first stanza of the new menu.lst to the old master menu.lst. I have a boot partition that contains all the boot stuff for all the current OS copied there, so I can boot from there or from the partition in question. More insurance I can get in.

My boot partition has a link to itself named boot. There is no boot directory, as that is on the / partition of whichever OS initially installed grub to the mounted boot partition. I don't have the boot partition mounted at /boot, or anywhere else, unless I need to add something to it.

With a new installation, when it is done, I boot another installed OS or a liveCD, mount the new / partition on /mnt/here, and the boot partition on /mnt/boot. Using konqueror in root mode, I copy /boot from the / partition to the boot partition. As there is a boot link, the system informs me there is already a "boot" there and asks for a new name for the directory. I name it for the OS. The copied directory for the public beta 1 is named pbeta1, the directory for the second beta is simply beta2.

The stanza to boot from that directory looks like this;

title Beta 2
kernel (hd0,0)/beta2/vmlinuz BOOT_IMAGE=Beta_2 root=LABEL=beta2  resume=LABEL=swap1000 splash=verbose vga=791
initrd (hd0,0)/beta2/initrd.img

The stanza for the first beta is this;

title Pbeta-1                                                                                                                 
kernel (hd0,0)/pbeta1/vmlinuz BOOT_IMAGE=Pbeta-1 root=LABEL=pbeta1  resume=LABEL=swap1000 nopat splash=verbose vga=791       
initrd (hd0,0)/pbeta1/initrd.img


And the stanza for the TR5 installation on the external drive shares the kernel and initrd image with the copy on the internal drive, so it's stanza is;

title TR5
kernel (hd0,0)/vmlinuz BOOT_IMAGE=TR5 root=LABEL=TR5 acpi=on resume=LABEL=swap1000 splash=verbose vga=791
initrd (hd0,0)/initrd.img


Note there is no reference to /boot or any other directory before /vmlinuz or /initrd.img in the last stanza. Those items are in the root of that partition.                                                                                     

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

csolomon

  • Guest
Re: Moving installation of pclinuxos to new hard drive
« Reply #14 on: March 18, 2010, 10:05:58 AM »
Quote
Quote

So all is well and working, but I don't understand how grub is reading the configuration files. I mean, I have two of them now:
/dev/sda4/boot/grub/menu.lst (from my Mepis install)
/dev/sdb2/boot/grub/menu.lst (from Arch install)

When I got the chance to edit the grub file before finishing Arch install, I edited it to add the Mepis install info because it wasn't there automatically. 

So now when the computer boots, how does Grub "know" which file to use?  Is there a pointer or something in the MBR on /dev/sda that points to /dev/sdb2/boot/grub/menu.lst? (which IS the one being used)

Yes. The installer tells it which partition is the one with the relevant boot files, so that's where it looks.

I install all new installation's grub to the partition's boot sector. Then I add the first stanza of the new menu.lst to the old master menu.lst. I have a boot partition that contains all the boot stuff for all the current OS copied there, so I can boot from there or from the partition in question. More insurance I can get in.

My boot partition has a link to itself named boot. There is no boot directory, as that is on the / partition of whichever OS initially installed grub to the mounted boot partition. I don't have the boot partition mounted at /boot, or anywhere else, unless I need to add something to it.

With a new installation, when it is done, I boot another installed OS or a liveCD, mount the new / partition on /mnt/here, and the boot partition on /mnt/boot. Using konqueror in root mode, I copy /boot from the / partition to the boot partition. As there is a boot link, the system informs me there is already a "boot" there and asks for a new name for the directory. I name it for the OS. The copied directory for the public beta 1 is named pbeta1, the directory for the second beta is simply beta2.

That just blew my mind.  I'm gonna need a bit of time and a brain massage for that to sink in...

After reading your whole post several times, I still don't understand how the boot configuration is determined.  I specified the MBR of /dev/sda to look at /dev/sdb2/boot/grub/menu.lst in the Arch installation (or at least that's what I am guessing happened).  How do I control that now?  What if I want to change back to using my old file (/dev/sda4/boot/grub/menu.lst)?

And what about the MBR on /dev/sdb?  Why isn't it clamoring to have a menu.lst file to point to?

How does the arbitration between the MBR of two hard drives happen? Is it always "hd0" that gets first dibs? (and if there is a boot config pointer there, all others are ignored?)

Maybe your description of your own system answered those questions and I just didn't get it.  Sorry if I'm seeming dense.  I appreciate all the help.