Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help install Gentoo
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
rudy
n00b
n00b


Joined: 12 Sep 2003
Posts: 29
Location: Planet Earth

PostPosted: Thu Mar 15, 2012 5:36 pm    Post subject: Help install Gentoo Reply with quote

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
Code:
cp -vpR
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
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Thu Mar 15, 2012 6:09 pm    Post subject: Reply with quote

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. :wink:
Back to top
View user's profile Send private message
rudy
n00b
n00b


Joined: 12 Sep 2003
Posts: 29
Location: Planet Earth

PostPosted: Thu Mar 15, 2012 6:24 pm    Post subject: Reply with quote

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. :wink:


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
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Thu Mar 15, 2012 6:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Thu Mar 15, 2012 7:01 pm    Post subject: Reply with quote

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 :wink:
Back to top
View user's profile Send private message
rudy
n00b
n00b


Joined: 12 Sep 2003
Posts: 29
Location: Planet Earth

PostPosted: Thu Mar 15, 2012 7:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Thu Mar 15, 2012 7:36 pm    Post subject: Reply with quote

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 :wink:
Back to top
View user's profile Send private message
rudy
n00b
n00b


Joined: 12 Sep 2003
Posts: 29
Location: Planet Earth

PostPosted: Thu Mar 15, 2012 8:00 pm    Post subject: Reply with quote

Quote:
Good luck and enjoy your new computer


Thank you -your help so much appreciated. :D
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Thu Mar 15, 2012 8:24 pm    Post subject: Reply with quote

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?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
rudy
n00b
n00b


Joined: 12 Sep 2003
Posts: 29
Location: Planet Earth

PostPosted: Thu Mar 15, 2012 10:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Kaso_da_Zmok
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 189
Location: Zurich, Switzerland

PostPosted: Thu Mar 15, 2012 11:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2581
Location: Here and Away Again

PostPosted: Thu Mar 15, 2012 11:47 pm    Post subject: ><)))°þ Reply with quote

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. :P


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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21706

PostPosted: Fri Mar 16, 2012 2:30 am    Post subject: Reply with quote

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
View user's profile Send private message
botdotcom
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2012
Posts: 100
Location: where no GTK

PostPosted: Fri Mar 16, 2012 1:58 pm    Post subject: Reply with quote

10 partitions

U nuts dude! I'd erase all that partition table and start it again...
_________________
http://images2.wikia.nocookie.net/__cb20070325035909/uncyclopedia/images/a/a3/Long-March.jpg
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2581
Location: Here and Away Again

PostPosted: Fri Mar 16, 2012 3:48 pm    Post subject: Reply with quote

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. :wink:


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
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