Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cant move compiled kernel to /boot
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Mon Apr 12, 2010 10:26 pm    Post subject: Cant move compiled kernel to /boot Reply with quote

Hello, I am currently in the process of installing gentoo and all has went well up to thus point.
There are two issues I have just run into

First off I am compiling a generic amd64 kernel for an intel t4300 processor.
All menuconfig settings point to this but after it compiled it was placed in
arch/x86/boot
according to the gentoo manual I should be copying it from
arch/x86_64/boot

well I put in the command cp arch/x86/boot/bzImage /boot/kernel
and receive the error cp: cannot create regular file /boot/kernel: read only file system

and of course if I input
arch/x86_64/boot/bzImage /boot/kernel I get file does not exist (b/c it doesn't duh)

also after any advice given please tell me from what location I should be imputing the commands from because
I was browsing through diff dirs and don't remember where it left me off at after generating the kernal.

Tia very much for any help!
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Mon Apr 12, 2010 11:05 pm    Post subject: Re: Cant move compiled kernel to /boot Reply with quote

TH0M4SJ wrote:
well I put in the command cp arch/x86/boot/bzImage /boot/kernel
and receive the error cp: cannot create regular file /boot/kernel: read only file system

Can you post the output of
Code:
# mount
This will help us figure out why your /boot is not writeable.
Back to top
View user's profile Send private message
pdr
l33t
l33t


Joined: 20 Mar 2004
Posts: 618

PostPosted: Mon Apr 12, 2010 11:29 pm    Post subject: Reply with quote

You are running with a 32-bit system, not 64-bit. They have separate gentoo-sources-2.6.31/2-rxx ebuilds (right now stable 32-bit is 2.6.32 but stable 64-bit is 2.6.31). Make sure that:

1. You are booting from a 64-bit live CD for installation purposes.

2. You follow the x86_64 Handbook for installation (in particular for where your stage-3 is located on the mirror servers).

3. /boot being read-only: make sure you are still chroot'd into /mnt/gentoo (if not you are using the live CD's directory structure and /boot probably is read-only). Biggest danger with this is if you started the sshd daemon and ssh into the box later (you are ssh'ing into the live CD environment, not the chroot's /mnt/gentoo environment).

I can't find it right now, but I'm pretty sure that something in the stage3 file (I don't think it is just the CHOST declaration in /etc/make.conf) tells portage to use, say, the 64-bit kernel source vs the 32-bit kernel sources (and the sources - in particular the make files - are what determine the kernel will end up in /usr/src/linux/x86_64/.. instead of /usr/src/linux/i386/...).
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21706

PostPosted: Mon Apr 12, 2010 11:40 pm    Post subject: Reply with quote

pdr wrote:
You are running with a 32-bit system, not 64-bit.
On what evidence are you basing that assumption?
pdr wrote:
They have separate gentoo-sources-2.6.31/2-rxx ebuilds (right now stable 32-bit is 2.6.32 but stable 64-bit is 2.6.31).
Technically, they are the same ebuild and install the same sources. The difference comes about from the environment which is used to build them.
pdr wrote:
I can't find it right now, but I'm pretty sure that something in the stage3 file (I don't think it is just the CHOST declaration in /etc/make.conf) tells portage to use, say, the 64-bit kernel source vs the 32-bit kernel sources (and the sources - in particular the make files - are what determine the kernel will end up in /usr/src/linux/x86_64/.. instead of /usr/src/linux/i386/...).
The kernel build system decides what to build based on the architecture which runs it, influenced by the value of $CROSS_COMPILE if set.

Regarding the problem of x86/x86_64, that is an old issue. Back in 2.6.24, the 32-bit and 64-bit builds were unified. Could you post a link to the handbook that gave you stale advice? Using arch/x86/ is correct for both 32-bit and 64-bit kernels.
Back to top
View user's profile Send private message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Tue Apr 13, 2010 12:20 am    Post subject: Reply with quote

Thanks for all the responses..as soon as I get home I'll post my mount output
at work...my shift ends in a couple hours

also I am using the amd64 handbook printable version...since it's all one page I can't give u a link to the particular page. I printed it ou only a week ago so if it's off I'm sure it still is.

Glad to know one problem is ok hopefully I can sort out the second
Back to top
View user's profile Send private message
rh1
Guru
Guru


Joined: 10 Apr 2010
Posts: 501

PostPosted: Tue Apr 13, 2010 1:47 am    Post subject: Reply with quote

Quote:
also after any advice given please tell me from what location I should be imputing the commands from because
I was browsing through diff dirs and don't remember where it left me off at after generating the kernal.


You can be in any dir you want , the instructions assume you are in /usr/src/linux which is why the cp command starts with arch , but you could easily do
"cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/yourkernelnamehere" from anywhere.

Quote:
Regarding the problem of x86/x86_64, that is an old issue. Back in 2.6.24, the 32-bit and 64-bit builds were unified. Could you post a link to the handbook that gave you stale advice? Using arch/x86/ is correct for both 32-bit and 64-bit kernels.


Here's your link ,
http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=7
Quote:
Code Listing 3.8: Installing the kernel
# cp arch/x86_64/boot/bzImage /boot/kernel-2.6.31-gentoo-r6

This is from the current amd64 handbook, I've always copied from arch/x86_64 for 64bit which works fine. Never heard/tried it from arch/x86 for a 64bit system. I'll have to test that out.
Back to top
View user's profile Send private message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Tue Apr 13, 2010 4:05 am    Post subject: Reply with quote

[quote="rh1"]
Quote:


You can be in any dir you want , the instructions assume you are in /usr/src/linux which is why the cp command starts with arch , but you could easily do
"cp /usr/src/linux/arch/x86_64/boot/bzImage /boot/yourkernelnamehere" from anywhere.

I pretty much assumed that, considering im out of my element here i didnt want to be ignorant.

Quote:

This is from the current amd64 handbook, I've always copied from arch/x86_64 for 64bit which works fine. Never heard/tried it from arch/x86 for a 64bit system. I'll have to test that out.


i dont know if its something that can be tested. the fact is the kernel is located in x86 for me, not both so i have no choice but to cp from that loation.

And here is my mount output:
(chroot) live cd boot # mount
rootfs on / type rootfs (rw)
tmpfs on / type tmpfs (rw,relatime)
/dev/sr0 on /mnt/cdrom type iso9660 (ro,relatime)
/dev/loop0 on /mnt/livecd type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)
devpts on /dev/pts type devpnts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /mnt/livecd/lib64/firmware type tmpfs (rw,relatime)
tmpfs on /mnt/livecd/usr/portage type tmpfs (rw,relatime)
usbfs on /proc/bus/usb type usbfs (rw,nosuid,noexec,relatime,devgid=85,devmode=664)
/dev/sda4 on / type ext3 (rw,relatime,errors=continue,data=writeback)
/dev/sda1 on /boot type ntfs (ro,relatime,uid=0,gid=0,fmask=0117,dmask=077,nls=iso8859-1,errors=continue,mft_zone_multiplier=1)
none on /proc type proc (rw,relatime)
udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)

im assuming my problem lies somewhere in line 14?
TIA
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21706

PostPosted: Tue Apr 13, 2010 4:17 am    Post subject: Reply with quote

My latest 2.6.33 kernel has the arch/x86_64 directory, but if you dig down, you find that its sole contents is a symlink to the image in the arch/x86 directory. So the handbook is still technically right, though it could be a bit misleading. ThomasJ, what kernel version are you building?

Using ntfs for /boot is highly unusual. I cannot comment on whether it will work, but it is probably the reason that you ended up with a read-only mount. Is there a reason you chose to use ntfs instead of a Linux filesystem?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9538
Location: beyond the rim

PostPosted: Tue Apr 13, 2010 11:27 am    Post subject: Reply with quote

Hu wrote:
Using ntfs for /boot is highly unusual. I cannot comment on whether it will work, ...

It's not going to work, grub doesn't have a NTFS driver.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10590
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Apr 13, 2010 11:32 am    Post subject: Reply with quote

More likely it's unintentional and /dev/sda1 is a working Windows install.

Thomas, can you share how you intended to partition the drive? I'm guessing
  • Partition 1: Windows
  • Partition 2: Gentoo Boot
  • Partition 3: Gentoo Swap
  • Partition 4: Gentoo Root
as this is really common. If this is correct, you can fix this really easily:
Code:
# exit
# umount /mnt/gentoo/boot
# mount /dev/sda2 /mnt/gentoo/boot
# chroot /mnt/gentoo /bin/bash

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Tue Apr 13, 2010 1:05 pm    Post subject: Reply with quote

... besides chrooting is, according to the Handbook, required before building the kernel, and would have been impossible if the arches were somehow mixed.

But there is still a mixup somewhere, therefore 2 problems - ntfs and something else.
If you didn't explicitly create a boot partition when fdisking, then your /boot is on the / partition - therefore already mounted.
Or maybe it's what John suggests, therefore must be mounted.

Please post the output of:
  • fdisk -l
  • cat /etc/fstab

Are you using x86 or amd64, and are you following the corresponding version of the Handbook?

All of this is easy to fix. :)
Back to top
View user's profile Send private message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Tue Apr 13, 2010 1:58 pm    Post subject: Reply with quote

ok thanks guys. yes i am installing gentoo alongside windows 7. I have had ubuntu installed with grub all fully working a month ago, deleted those and used the windows recovery console to restore my mbr. Haven't had any issues with that, those were installed using the latest ubuntu ultimate edition 64 bit live cd.

heres my fdisk printout


/dev/sda1/ * 1 26 203776 7 hpfs/ntfs
/dev/sda2/ 26 20037 160737045 7 hpfs/ntfs
/dev/sda3/ 20037 20045 69617+ 83 linux
/dev/sda4/ 20046 22657 20980890 83 linux

1-boot
2-windows
3-swap ( i know its crazy small im not sure what happened there, i am going to go back and set a new on up)
4-gentoo install

will give suggestions offered so far in between responses, as always thanks for all the assistance

EDIT: just figured i'd add, partitions one and two were pre installed on the laptop and never altered. i added 3 and 4.
i have since shutdown the live cd and booted into windows from which i am posting now hoping i can boot the live cd back up
and just pick up where i left off.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Tue Apr 13, 2010 4:01 pm    Post subject: Reply with quote

Ok, your /boot is a folder on the / partition, so it's mounted on hd0,2 which is /dev/sda3

Your grub.conf needs to know that so something like should work:
Code:
root (hd0,2)
kernel /boot/<kernelname> root=/dev/sda3
Back to top
View user's profile Send private message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Tue Apr 13, 2010 4:17 pm    Post subject: Reply with quote

Mike Hunt wrote:
Ok, your /boot is a folder on the / partition, so it's mounted on hd0,2 which is /dev/sda3

Your grub.conf needs to know that so something like should work:
Code:
root (hd0,2)
kernel /boot/<kernelname> root=/dev/sda3


apparently im a little lost here and not following you.

when you say "/ partition" what exactly is that, i thought sda1,sda2,...were my partitions.
also my sda3 is set as swap.. that is where my /boot is?

and lastly i dont think grub is even part of my problem at this point seeing as i have not even begun to install it.
my problem is when i need to move my compiled kernel to the /boot location it is not allowing me.
nothing to do with actually booting up yet
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Tue Apr 13, 2010 4:23 pm    Post subject: Reply with quote

The '/' partition = the root partition which is on /dev/sda4 on your box, so my previous post was wrong.
And I'm jumping ahead. Sorry for the inconvenience.

It should read:

Since the /dev/sda1 is a /boot partition created for windows by the pre-installation, maybe it's better to just leave it alone and use the Gentoo root ('/') partition for the Gentoo /boot folder.

If your /boot is a folder on the / partition, so it's mounted on hd0,3 which is /dev/sda4

Your grub.conf needs to know that so something like this should work:

Code:
root (hd0,3)
kernel /boot/<kernelname> root=/dev/sda4


Now when you emerge, compile... kernel, are you chrooted in?
How did you mount /mnt/gentoo ?
It should be:
Code:
mount /dev/sda4 /mnt/gentoo
Back to top
View user's profile Send private message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Tue Apr 13, 2010 4:34 pm    Post subject: Reply with quote

Mike Hunt wrote:
The '/' partition = the root partition which is on /dev/sda4 on your box, so my previous post was wrong.
And I'm jumping ahead. Sorry for the inconvenience.

It should read:

Ok, your /boot is a folder on the / partition, so it's mounted on hd0,3 which is /dev/sda4

Your grub.conf needs to know that so something like this should work:

Code:
root (hd0,3)
kernel /boot/<kernelname> root=/dev/sda4


Now when you emerge, compile... kernel, are you chrooted in?
How did you mount /mnt/gentoo ?
It should be:
Code:
mount /dev/sda4 /mnt/gentoo


no problem, i am gracious for the help.

yes i am chrooted in. and that is how i mounted it (as per manual)
i did
mount /dev/sda4 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot

no errors returned.


looks as follows more or less:
(chroot) live cd arch # cp arch/x86/boot/bzImage /boot/kernel
error cp: cannot create regular file /boot/kernel: read only file system

so how exactly do i go about changing /boot to my root


Last edited by TH0M4SJ on Tue Apr 13, 2010 4:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Tue Apr 13, 2010 4:37 pm    Post subject: Reply with quote

Exactly, that's becaust the windows /boot partition is mounted and shouldn't be.
See my previous post, because I edited while you were writing.

To fix that unmount it:
Code:
umount /boot


Now you should have a /boot folder on your Linux root ('/') partition that was created by the stage3, check like this:
Code:
ls /
Back to top
View user's profile Send private message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Tue Apr 13, 2010 4:44 pm    Post subject: Reply with quote

ok so make sure sda1 is not mounted, input the cp command and all should be well?

EDIT:

also just curious is there somewhere online that has the files listed that should be within directories by default (in my case arch/x86)
i dont see the bzImage file in there but there is 'kernel" listed.
since i was trying to cp the bzImage to be named kernel i was wondering if that is my kernel or another
file that should be there. not sure if when playing around i cp the bzImage to the same dir thus changing it to kernel.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Tue Apr 13, 2010 5:58 pm    Post subject: Reply with quote

Ok wait, I still don't know if you're using x86 or amd64.
If you installed using a 64 bit CD, which stage3 did you fetch?
And if it's i686-stage3, how did you manage to chroot?

The basic file layout is established by stage3 and fits in to the mounted partitioning scheme.
The /boot directory is created then, but there is nothing in it until the kernel is installed and grub is emerged.
You can name your kernel anything you want.
The important bit is using the exact same kernel name in /boot and in grub.conf.

BTW, I'm sure there must be a way to use/convert/adapt the windows /boot partition for Gentoo without causing problems, but I haven't touched a windows pc since the last millenium.
There are others here who will help with that. And that part of the installation can easily be re-done later on.
Back to top
View user's profile Send private message
dwbowyer
Apprentice
Apprentice


Joined: 18 Apr 2008
Posts: 155

PostPosted: Tue Apr 13, 2010 6:32 pm    Post subject: Reply with quote

Quote:

Code:

/dev/sda1/ * 1 26 203776 7 hpfs/ntfs
/dev/sda2/ 26 20037 160737045 7 hpfs/ntfs
/dev/sda3/ 20037 20045 69617+ 83 linux
/dev/sda4/ 20046 22657 20980890 83 linux


You said the firt 2 partitions came pre-installed. Likely, the first partition is a Windows recovery partition. It would be a disk image that can be used to
reinstall if the system became corrupted. Many pre-installed PCs have been doing that for a few years, rather than providing a bootable CD/DVD.
That would be why you have 2 ntfs partitions (most likely).

EDIT: I realize now that your /dev/sda1 is a Windows 7 boot partition, after reading, other forum posts. I don't have any MS experience in the last 7 years,
and didn't realize Windows 7 did this now.

/dev/sda3 and /dev/sda4 are both type 83 Linux... Chances are, sda3 was meant to be the /boot partition, as it is about the right size for a boot partition,
(you would have mounted it as "mount /dev/sda3 /mnt/gentoo/boot" during installation process), and as it stands you have NO swap.
Swap would be type 82 Linx Swap / Solaris.

Depending on how much memory you have, you may not actually need any swap, there is a bit of debate about that. But if you do ever run out of available
memory, the system could crash without swap. If you have less than 1GB ram, or will be using many memory intensive programs and have less than
2-3GB ram, then you would need swap. You would need to be familiar with Linux and know your memory needs/usage patterns to estimate how much
memory you actually can call enough. Otherwise, you should have swap set up. IE since you are fairly new to Linux, best have swap setup until you are
experienced enough to be SURE you do/don't need it.

The guide perhaps needs to stress this more, but commands that are entered are NOT meant to be taken as string literals, but rather as examples.
IT can not in all cases know a particular users hardware setup (such as the fact that you have Windows 7 installed and are setting up dual-boot).
Only for a user installing on an empty drive ( and only of it is the first Sata drive) do the Handbook's commands:

Code:

"mount /dev/sda3 /mnt/gentoo"
"mount /dev/sda1 /mnt/gentoo/boot"

happen to be literal. For you it would be:
Code:

"mount /dev/sda4 /mnt/gentoo"
"mount /dev/sda3 /mnt/gentoo/boot"


Quote:

ok so make sure sda1 is not mounted, input the cp command and all should be well?

EDIT:
also just curious is there somewhere online that has the files listed that should be within directories by default (in my case arch/x86)
i dont see the bzImage file in there but there is 'kernel" listed.
since i was trying to cp the bzImage to be named kernel i was wondering if that is my kernel or another
file that should be there. not sure if when playing around i cp the bzImage to the same dir thus changing it to kernel.

Do not mount either of /dev/sda1 /dev/sda2 during the install process, no good will come of it, in your case. I recommend resizing
the /dev/sda4 partition to make it 512MB smaller, leaving the empty space at the end and having /dev/sda5 be your swap.

IF you can't resize the last partition, then you may have to delete then recreate it, and then /dev/sda5. Doing that will mean starting the
installation over from the beginning which is why recommend resizing the existing /dev/sda4 as a first choice.

In the /usr/src/linux/arch/x86/boot/
directory there would not normally be a "kernel" file (or at least I've never seen one by that name). So yes, more than likely as some point you
must have done something like

"mv bzImage kernel" <--------- would MoVe (RENAME) the file into the same directory, rather than CoPy it to a new name.

You can "ls -l kernel" in that directory to determine if indeed it is a bootable kernel.

From my /boot directory
Code:

amd64 boot # ls -l /boot
total 13M
drwxr-xr-x 2 root root 1.0K Jun  2  2009 grub
drwx------ 2 root root  12K Apr 19  2009 lost+found
-rw-r--r-- 1 root root    0 Apr 14  2009 .keep
-rw-r--r-- 1 root root 3.0M Jun 14  2009 2.6.29-gentoo-r5
-rw-r--r-- 1 root root 3.0M Dec 13 12:47 2.6.30-gentoo-r8
-rw-r--r-- 1 root root 3.1M Mar  7 06:27 2.6.31-gentoo-r10
-rw-r--r-- 1 root root 3.2M Mar 24 01:32 2.6.31-gentoo-r10-ntfs
lrwxrwxrwx 1 root root    1 Apr 19  2009 boot -> .


Note that a kernel would (in most cases) be more than 2.5 MB in size. Mine are 3.0-3.2 MB.
Also note that a kernel file whatever it's name, is NOT a executable file. Readable/writable
yes. The boot loader passes control to the kernel, it doesn't execute it in the way executable
programs are run. That will help you to determine if your "kernel" file is really a kernel.
Back to top
View user's profile Send private message
TH0M4SJ
n00b
n00b


Joined: 10 Apr 2010
Posts: 12

PostPosted: Tue Apr 13, 2010 9:30 pm    Post subject: Reply with quote

[quote="dwbowyer"]
Quote:
Quote:

Code:

/dev/sda1/ * 1 26 203776 7 hpfs/ntfs
/dev/sda2/ 26 20037 160737045 7 hpfs/ntfs
/dev/sda3/ 20037 20045 69617+ 83 linux
/dev/sda4/ 20046 22657 20980890 83 linux


You said the firt 2 partitions came pre-installed. Likely, the first partition is a Windows recovery partition. It would be a disk image that can be used to
reinstall if the system became corrupted. Many pre-installed PCs have been doing that for a few years, rather than providing a bootable CD/DVD.
That would be why you have 2 ntfs partitions (most likely).

EDIT: I realize now that your /dev/sda1 is a Windows 7 boot partition, after reading, other forum posts. I don't have any MS experience in the last 7 years,
and didn't realize Windows 7 did this now.


correct sda1=windows boot part, sda2=windows install, there was sda3 with the recovery image you described, i deleted it.
I figured i would use the windows boot partition for gentoo but it seems this will not be the case
sda3 was supposed to be the swap but something didnt work out quite right, user error im sure, ill most likely delete it and make a new one
and sda4 is root.



Quote:

Code:

"mount /dev/sda3 /mnt/gentoo"
"mount /dev/sda1 /mnt/gentoo/boot"

happen to be literal. For you it would be:
Code:

"mount /dev/sda4 /mnt/gentoo"
"mount /dev/sda3 /mnt/gentoo/boot"


ok so i will leave these two as is and use sda3 as boot, easy enough.
one side note, fdisk labels sda3 as swap. i need to turn swap off first?



Quote:

Do not mount either of /dev/sda1 /dev/sda2 during the install process, no good will come of it, in your case. I recommend resizing
the /dev/sda4 partition to make it 512MB smaller, leaving the empty space at the end and having /dev/sda5 be your swap.

i have over 100G of unallocated space so resizing shouldnt be necessary i will just create the new partition.

Quote:

In the /usr/src/linux/arch/x86/boot/
directory there would not normally be a "kernel" file (or at least I've never seen one by that name). So yes, more than likely as some point you
must have done something like

"mv bzImage kernel" <--------- would MoVe (RENAME) the file into the same directory, rather than CoPy it to a new name.



well regardless of what that was in there, my kernel turned up in the /x86_64 folder (i swear it wasnt there last time, im new to linux not retarded...or maybe i am but i was shocked as all hell to find it now where it should have been all along)
i cp the kernel to boot in my /

but where it really needs to go is in the /boot partition right. (in my case soon to be sda3)


again thank you all for your patience, you guys are awesome, hopefully i too will soon be able to contribute to the gentoo community.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9538
Location: beyond the rim

PostPosted: Tue Apr 13, 2010 10:04 pm    Post subject: Reply with quote

Remember that you can only have four primary partitions, so if you already have sda1-4, you can't create sda5. You have to delete one of the others first and replace it with an extended/logical partition. Otherwise even if you have 100G unallocated you can't actually use it.
Back to top
View user's profile Send private message
dwbowyer
Apprentice
Apprentice


Joined: 18 Apr 2008
Posts: 155

PostPosted: Tue Apr 13, 2010 11:39 pm    Post subject: Reply with quote

Labels and partition types are two separate things.

The partition type of your /dev/sda3 was a Linux file system, NOT a swap partition.
And given it's size in sectors, I'm guessing it was maybe 64ish MB in size, about what a
/boot partition would be.

You can LABEL a partition anything, that is a helper for the administrator to know
what a partition is for in more complicated setups. (I believe is is actually possible
to mount a partition based on it's label, but I've never done it). It's moot, as you don't
mount partitions.

You did not actually create a swap partition. It would depend on the /etc/fstab file,
how that partition was used, or even IF it was used.

you might try posting that later. But, I'll show you (part) of mine, and then how yours ought to look.

Code:

/dev/sda1     /boot   ext2   noauto     1 2
/dev/sda2     none    swap   sw         0 0
/dev/sda3     /       xfs    defaults   0 1


Fdisk creates a partition type, but does not format to a File System, that is a
separate step....
The Partiton Type (shown in fdisk or similar program), essentially is used to
tell you which Operating System a partition was created for.

Then you format the partition using one of mkfs*
Code:

ll /sbin/mkfs*
-rwxr-xr-x 1 root root 5.3K Feb 26 17:43 /sbin/mkfs
-rwxr-xr-x 1 root root  14K Feb 26 17:43 /sbin/mkfs.bfs
-rwxr-xr-x 1 root root  22K Feb 26 17:43 /sbin/mkfs.cramfs
lrwxrwxrwx 1 root root    6 Feb 26 17:55 /sbin/mkfs.ext2 -> mke2fs
lrwxrwxrwx 1 root root    6 Feb 26 17:55 /sbin/mkfs.ext3 -> mke2fs
lrwxrwxrwx 1 root root    6 Feb 26 17:55 /sbin/mkfs.ext4 -> mke2fs
lrwxrwxrwx 1 root root    6 Feb 26 17:55 /sbin/mkfs.ext4dev -> mke2fs
-rwxr-xr-x 1 root root  19K Feb 26 17:43 /sbin/mkfs.minix
-rwxr-xr-x 1 root root  66K Apr  8 16:59 /sbin/mkfs.xfs


For someone coming from MS Windows, the choice of the mkfs above is like
choosing to format as either FAT, VFAT, FAT32, or NTFS, if you understand
those choices. But here in Linux, the choices (and understand that there are
other choices too that I don't have installed on my system) are
bfs cramfs minix -- which I don't even use
ext2, ext3, ext4 and xfs -- which I do.

The various ext* are actually different versions of one FS type.


Note that my boot partition is code block above is /dev/sda1 and ext2 File System.
My / is /dev/sda3 and xfs File System.
Fdisk would report BOTH as partition type 83 Linux.

Note my swap is /dev/sda2 and mount point is "none". Swap partitions are not mounted.
Instead there is (are) command that de/activates them.
Code:

 ll /sbin/swapo*
lrwxrwxrwx 1 root root   6 Feb 26 17:43 /sbin/swapoff -> swapon
-rwxr-xr-x 1 root root 22K Feb 26 17:43 /sbin/swapon

(This is extra info, you don't necessarily need...
Above, you can see it's actually one command with a link with another name...
Internally, the executable script determines which name it was called with in order
to decide whether to either turn on, or turn off swap. It is equivalent to executing a
script as swap --on, or swap --off.)

Back on topic,
my /dev/sda2 is partition type "82 Linux Swap /Solaris" according to fdisk
In /etc/fstab:
1. is not given a mount point,
2. is denoted FS type "swap" (which CAN be but is *not* necessarily formatted as SWAP
3. and has "mount option" of "sw" -- even though it technically isn't mounted.

That is the background and explanation (Expect a need to learn great deal about OS
internals in order to use Linux, and even more to use Gentoo Linux).


Here is what you really want to know:

You had to format your /dev/sda3 and your /dev/sda4 as a File System Type,
not just specify a Partition Type in fdisk. You will need to know the FS format you used.
in the <> below goes the FS format, probably one of
ext2, ext3, ext4
Code:

/dev/sda3   /boot  <FS>  noauto    1 2
/dev/sda4   /      <FS>  defaults  0 1

#As of your last post, you hadn't created this one yet.
#YAY for unreserved space on your drive.
/dev/sda5   none   swap   sw       0 0


Those are the basic entries you start with in /etc/fstab.
There are other mount options you can specify, such as noatime.
I won't go into any of those any further, at this time.

Now we get to a critical step...
Understand that the documentation in the HANDBOOK for GRUB has to be
adapted for your particular case too.

This is my /boot/grub.conf, and in MY case, I can follow the HANDBOOK exactly:
Quote:

cat /boot/grub/grub.conf
# 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 10
# Comment this out to not use GRUB splash image, IE b&w text
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 2.6.31-r10
root (hd0,0)
kernel /boot/2.6.31-gentoo-r10 root=/dev/sda3


You need slightly different entries from the HANDBOOK that you need in order to boot
YOUR kernel and Linux System:

Quote:

splashimage=(hd0,2)/boot/grub/splash.xpm.gz

title <What ever you would like it to read>
#don't let the word root confuse you below
# It's not used in this context
# the same way as for Linux.

# /dev/sda3 (your Linux /boot), where GRUB can find the kernel
root (hd0,2)
# root=/dev/sda4 below means GRUB: find my Linux root directory entry
# on the following partition
kernel /boot/<your-kernel-name> root=/dev/sda4

# kernel line could read
# replacing the 2 lines above
kernel (hd0,2)/boot/<your-kernel-name> root=/dev/sda4

# And Finally, if you did NOT have a /boot partition
kernel (hd0,3)/boot/<your-kernel-name>
# At least I think that's right
# not sure since I don't do it that way.
# Ask someone from the NO/bootPARTITION cult


I hope that helps you get on your way, while at the same time helping you to
understand it better.
Back to top
View user's profile Send private message
dwbowyer
Apprentice
Apprentice


Joined: 18 Apr 2008
Posts: 155

PostPosted: Tue Apr 13, 2010 11:44 pm    Post subject: Reply with quote

Genone wrote:
Remember that you can only have four primary partitions, so if you already have sda1-4, you can't create sda5. You have to delete one of the others first and replace it with an extended/logical partition. Otherwise even if you have 100G unallocated you can't actually use it.


Oh hell, I forgot that part. Spent over an hour just formatting my previous message.
Edit: in that case may be worth just putting a swapfile on the root parttion, rather than a separate
swap partition.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Apr 14, 2010 12:44 pm    Post subject: Reply with quote

... you can change the partition type for the /dev/sda3 with fdisk when you re-partartition your hard drive.
In fdisk press 'p' to print the current setup on screen, and m' for <menu> to see that 't' is to set the type, and 'l' for list, type 82 is swap.
Make heavy use of the 'p' option at each step.

Also in fdisk, delete /dev/sda4 and recreate it as extended/logical, then create partitions i.e. /dev/sda5, /dev/sda6 ....

If you use only /boot, '/' (root) and swap, then your '/' (root) for a rather typical installation should be at least 20GB or more.
You may eventually wind up needing the rest of the disk, then needing a bigger drive someday, probably sooner than later.
It depends on what you wish to save to disk.

Then please make sure you are using the exact same architecture for the installCD and the stage3.
If you want a 32 bit architecture, then use the x86 installCD and the i686 stage3.
-> (Note: SysrescueCD has both x86 and amd64 installations available).

The Gentoo Handbook is your key to success. It really works.
What dwbowyer said is spot on, the actual example commands are the correct and precise ones, but the parameters need to be slightly adjusted for each system.
That's the reason why Gentoo fits like a tailored glove, rather than one-size-fits-all.

You may even choose to reinstall more than once, for example trying different filesystem types.
But once you have decided on a partition scheme and filesystem type(s), then everything else can be adjusted without reinstalling from scratch.
Just go step-by-step.
Make sure that every step if perfect before moving on to the next step, that way you'll have a very impressive operating system.

Have fun, and report back should you run into issues.
And don't worry about the steep learning curve, it gets easier.
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
Goto page 1, 2  Next
Page 1 of 2

 
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