View previous topic :: View next topic |
Author |
Message |
rudy n00b
Joined: 12 Sep 2003 Posts: 29 Location: Planet Earth
|
Posted: Thu Mar 15, 2012 5:36 pm Post subject: Help install Gentoo |
|
|
Hi All,
I bought a new desktop, but as you already know they come with windows pre-installed.
I want to move my existing Gentoo installation from my old computer to the new one but also keep a copy of my windows 7.
This is what I did.
I resized and made partitions from the 250 GB HD which came along as follows:
/dev/sda1 NTFS *(active) 50 GB windows 7
/dev/sda5 NTFS Extended 133 GB
/dev/sda2 EXT2 200 MB for Gentoo Boot
/dev/sda/3 linux-swap 8 GB
/dev/sda4 XFS for Gentoo Root rest of the HD
Here are my questions:
1. Should I make /dev/sda2 active which means bootable?
2. If I copy over all the files from my old hard drive to /dev/sda2 and /dev/sda4 with this command will that be okay?
Yes I will chroot and recompile the kernel.
3. Given my configuration, what are the options from "grub" to enable a dual boot?
Thanks you in anticipation for your replies. |
|
Back to top |
|
|
BillWho Veteran
Joined: 03 Mar 2012 Posts: 1600 Location: US
|
Posted: Thu Mar 15, 2012 6:09 pm Post subject: |
|
|
rudy,
I think a better approach would be to install the old computer's hd as a secondary drive and use dd to mirror the partitions. |
|
Back to top |
|
|
rudy n00b
Joined: 12 Sep 2003 Posts: 29 Location: Planet Earth
|
Posted: Thu Mar 15, 2012 6:24 pm Post subject: |
|
|
BillWho wrote: | rudy,
I think a better approach would be to install the old computer's hd as a secondary drive and use dd to mirror the partitions. |
I can't.
My new Motherboard doesn't have any IDE port , only SATAs.
My old HDD is an IDE .
I just copy all my files to an external USB HDD and my next move would be to copy those files to my new desktop.
As for the other questions, no replies?
Last edited by rudy on Thu Mar 15, 2012 6:45 pm; edited 1 time in total |
|
Back to top |
|
|
BillWho Veteran
Joined: 03 Mar 2012 Posts: 1600 Location: US
|
Posted: Thu Mar 15, 2012 6:45 pm Post subject: |
|
|
A usb ide/sata adapter would be real handy right about now
How are you going to copy with cp? If you decide to go that route cp -av would be equivalent
And I forgot to include this for windows. It's a grub version 2 entry
Code: | menuentry "Windows 7 (loader) (on /dev/sda2)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(/dev/sda,msdos2)'
search --no-floppy --fs-uuid --set=root B05E98FC5E98BD12
chainloader +1
}
|
and this Quote: | 1. Should I make /dev/sda2 active which means bootable? |
only one partition should be marked as bootable and windows most likely is |
|
Back to top |
|
|
BillWho Veteran
Joined: 03 Mar 2012 Posts: 1600 Location: US
|
Posted: Thu Mar 15, 2012 7:01 pm Post subject: |
|
|
Quote: | I just copy all my files to an external USB HDD and my next move would be to copy those files to my new desktop. |
The external does the trick:
Code: | dd if=/dev/sd?? | gzip -c > /path/to/external/gentooboot.img.gz
gunzip -c /path/to/external/gentooboot.img.gz | dd of=/dev/sd?? |
Adjust for your partitions and do the same for root |
|
Back to top |
|
|
rudy n00b
Joined: 12 Sep 2003 Posts: 29 Location: Planet Earth
|
Posted: Thu Mar 15, 2012 7:12 pm Post subject: |
|
|
BillWho wrote: | A usb ide/sata adapter would be real handy right about now
How are you going to copy with cp? If you decide to go that route cp -av would be equivalent
And I forgot to include this for windows. It's a grub version 2 entry
Code: | menuentry "Windows 7 (loader) (on /dev/sda2)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(/dev/sda,msdos2)'
search --no-floppy --fs-uuid --set=root B05E98FC5E98BD12
chainloader +1
}
|
and this Quote: | 1. Should I make /dev/sda2 active which means bootable? |
only one partition should be marked as bootable and windows most likely is |
Thank you for your time.
Well, I don't think I've got grub version 2.
Actually, I've emerged grub-0.97-r10.
What would be your advice when I finished copy my boot and root files to their appropriate location?
Chroot, modify grub.conf, issue the command grub > in order to put grub in the MBR...etc.?
recompile the kernel to suit the new processor+drivers for wifi+ethernet....and so forth... |
|
Back to top |
|
|
BillWho Veteran
Joined: 03 Mar 2012 Posts: 1600 Location: US
|
Posted: Thu Mar 15, 2012 7:36 pm Post subject: |
|
|
Quote: | What would be your advice when I finished copy my boot and root files to their appropriate location? |
Your approach makes sense here as a kernel configuration would be required for the new architecture and peripherals. I would save the current .config and try make defconfig then take a look at what was detected and continue from there for the particular hardware. You can always reference your old .config for anything you might have overlooked.
It's been quite some time since I used grub-0.97 and I can't recall how to install it. Best thing to do would be to refer to gentoo's installation handbook. Grub should detect windows and make an entry for it in a new grub.conf file.
Good luck and enjoy your new computer |
|
Back to top |
|
|
rudy n00b
Joined: 12 Sep 2003 Posts: 29 Location: Planet Earth
|
Posted: Thu Mar 15, 2012 8:00 pm Post subject: |
|
|
Quote: | Good luck and enjoy your new computer |
Thank you -your help so much appreciated. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
rudy n00b
Joined: 12 Sep 2003 Posts: 29 Location: Planet Earth
|
Posted: Thu Mar 15, 2012 10:29 pm Post subject: |
|
|
Jaglover wrote: | I did not read every detail in this thread, but what's wrong with booting the new PC with some Linux (CD, DVD, USB) and using SCP or rsync to transfer the installation? |
Point me to any tutorial about using SCP or rsync.
BTW, can someone shed me some light into my ignorance about grub.
Given sda1 is the boot (active) partition for windows 7, when I will issue the command grub> should I tell grub that root is (hd0, 0) or the place where grub is installed thus sda2 ?
grub> root (hd0,0)
grub> setup (hd0)
or
grub> root (hd0,1)
grub> setup (hd0) |
|
Back to top |
|
|
Kaso_da_Zmok Apprentice
Joined: 19 Aug 2004 Posts: 189 Location: Zurich, Switzerland
|
Posted: Thu Mar 15, 2012 11:22 pm Post subject: |
|
|
this is correct
Code: | grub> root (hd0,1)
grub> setup (hd0) |
root should point to the partition with the kernel
Quote: | Grub should detect windows and make an entry for it in a new grub.conf file |
this is not true. you have to put it into the grub.conf yourself if it is not already there.
Code: | 1. Should I make /dev/sda2 active which means bootable? |
No,only if you would install grub into /dev/sda2 instead of /dev/sda MBR.
But every time you boot windows 7 it will remove the boot flag from that partition.
My concern is that your old gentoo system was compiled with cpu optimization that might be incompatible with your current setup.
Should be fine is the new CPU feature set contains all features of the old CPU. |
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2581 Location: Here and Away Again
|
Posted: Thu Mar 15, 2012 11:47 pm Post subject: ><)))°þ |
|
|
rudy,
Yes, 0.97-r10 would be 'Grub 1' (or 0) while 1.99-r2 would be considered Grub 2.
rudy wrote: | BTW, can someone shed me some light into my ignorance about grub.
Given sda1 is the boot (active) partition for windows 7, when I will issue the command grub> should I tell grub that root is (hd0, 0) or the place where grub is installed thus sda2 ?
grub> root (hd0,0)
grub> setup (hd0)
or
grub> root (hd0,1)
grub> setup (hd0) |
For what it is worth, I have Gentoo and Windoze 7 in a dual-boot setting and I basically just followed the directions in the Handbook.
Might be worth noting that I always installed Windoze first, then Gentoo, and this seemed to work the best or was most easy to set up.
Partition scheme (also basically À la Handbook) which I have been meaning to re-do for a while as it has become a bit 'messy' and inconvenient, but as it is my first successful install, I wanted to do it as it is in the Handbook at least once.
Code: | Device Boot Start End Blocks Id System
/dev/sda1 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 * 206848 116602879 58198016 7 HPFS/NTFS/exFAT
/dev/sda3 536442880 976760831 220158976 f W95 Ext'd (LBA)
/dev/sda4 116602880 536442879 209920000 83 Linux
/dev/sda5 536444928 577404927 20480000 b W95 FAT32
/dev/sda6 * 577404991 577472489 33749+ 83 Linux
/dev/sda7 577472553 578532779 530113+ 82 Linux swap / Solaris
/dev/sda8 578532843 617618924 19543041 83 Linux
/dev/sda9 617620973 827336172 104857600 83 Linux
/dev/sda10 827338221 976760831 74711305+ 83 Linux |
Grubby:
Code: | # This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.
default 0
timeout 3
splashimage=(hd0,5)/boot/grub/splash.xpm.gz
title (Default/Main thingy to boot.)
root (hd0,5)
#kernel /boot/kernel root=/dev/sda8 vga=0x361 usbhid.mousepoll=2
#kernel /boot/kernel root=/dev/sda8 vga=0x361
#kernel /boot/kernel root=/dev/sda8 video=vesafb:mtrr:3,ywrap vga=ask
kernel /boot/kernel root=/dev/sda8 video=uvesafb:1280x800-32,mtrr:3,ywrap
#kernel /boot/kernel root=/dev/sda8 vga=ask init=/sbin/bootchartd
title (Recovery boot; usually the most previous kernel build.)
root (hd0,5)
kernel /boot/kernel root=/dev/sda8 vga=0x361
title (Kernel for miscellaneous testing.)
root (hd0,5)
kernel /boot/kernel root=/dev/sda8 vga=0x361 usbhid.mousepoll=2
title (Windoze)
rootnoverify (hd0,1)
makeactive
chainloader +1 |
Yeah, still with the 'sample' comments and all!
I named the titles and kernel files differently from what they really are just for this post so that they make sense for others than me, too, so those are not errors.
I hope this can be of some help.
If not, at least I reminded myself of cleaning things up!
So thanks! _________________ Kindest of regardses. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21706
|
Posted: Fri Mar 16, 2012 2:30 am Post subject: |
|
|
BillWho wrote: | Code: | dd if=/dev/sd?? | gzip -c > /path/to/external/gentooboot.img.gz
gunzip -c /path/to/external/gentooboot.img.gz | dd of=/dev/sd?? |
| Note that this will copy the entire contents of the underlying block device, including any free space and sectors assigned to deleted files. Also, it will write an equivalent sized blob to the new block device. This has several problems:- The new filesystem will have the same capacity as the old one, even if the new partition is bigger than the old partition.
- The new partition must not be smaller than the old partition.
- Unnecessary sectors will be read from the old drive and written to the new one, spending I/O time on unwanted data.
- If the destination is an SSD, the SSD will mark as "used" sectors associated with this copy, even if they do not contain any allocated files.
|
|
Back to top |
|
|
botdotcom Tux's lil' helper
Joined: 27 Feb 2012 Posts: 100 Location: where no GTK
|
|
Back to top |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2581 Location: Here and Away Again
|
Posted: Fri Mar 16, 2012 3:48 pm Post subject: |
|
|
botdotcom,
If you think 10 is a lot, you haven't seen much, one might assume. :]
It might make more sense to you if you consider what they are for.
- 4 of them are for windows.
- 1 is Linux Swap.
- 1 is Linux Boot.
- 1 is Linux /.
- 1 is for Virtualisation and the likes.
- 2 are for different kinds of random storage like game installations, videos, pictures, et cetera.
And I don't even have a separate partition for /home since the scheme comes from the Handbook.
There are many reasons one might have more partitions, be it security, convention, or just plain personal taste.
When using windows, I usually never had more than 2 partitions for windows related stuff, one for windows and programs, one for 'my documents' and such, and then the random storage ones (usually another disk completely).
However with Linux, there are advantages one might like to make use of in ways such as using different file-systems for different works going on in different partitions.
As I mentioned earlier, I am going to re-do the scheme since it's the first install and I didn't know what I would be doing with it then, and I created new partitions as I needed, and actually forgot I had about 70GiB still unused some time ago. Oopsies.
But it is not because 10 is a lot.
Anyhow, not that I really know anything about anything, but I don't think 10 is a lot, and what suits you, might not suit me.
The topic at hand is not about partition-tables, though. I merely wanted to 'visualise' how a dual-boot setting can be set up.
I doubt it was even helpful as I imagine the user already knew/knows how it works.
Oh well. _________________ Kindest of regardses. |
|
Back to top |
|
|
|