LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-20-2003, 12:49 AM   #1
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Rep: Reputation: 30
How to change the boot parition in this way?


I installed redhat9.0 on hda12, hda13 is its boot paration, grub is at mbr.
I don't want to give the booting files a whole partition now, how to change the booting files to /hda12/boot directory?
I copyed all the files in /hda13 to /hda12/boot directory, and modify /etc/fstab and /gurb/gurb.conf, but it failed.
Could someone know this?
Thank you.

Last edited by Xiangbuilder; 10-20-2003 at 12:51 AM.
 
Old 10-20-2003, 01:06 AM   #2
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
What failed?
What's the error message you get?

It should just be a matter of making /boot on hda12 -- like you did
Then reconfigure fstab, like you said -- and change grub.conf to reflect the changes.

That should be all that's necessary.

What's the error?

-Shade
 
Old 10-20-2003, 02:17 AM   #3
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
Here is the error information when the machine is starting up:
root (hd0,11)/boot
FIlesystem type is ext2fs, partition type 0x83
kernel /boot/vmliuz-2.4.20-8 ro root=/dev/hda10
initrd /boot/initrd-2.4.20-8.img
Error 15: FIle not found

Here is my manipulation:
In /grub/grub.conf, modify
root (hd0,12) to root (hd0,11)/boot,

In /etc/fstab,
delete the line:
LABEL=/boot /boot ext3 defaults 1 2

I successfully chnaged the boot partition from hda13 to hda9, but I don't know what is my mistake when I try to change modify it to a directory.

Thank you.
 
Old 10-20-2003, 04:20 AM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
the ROOT command should point to the partition for /boot folder as its looking for where the kernel and initrd files are RELATIVE to this root.

try WITHOUT /boot

root (hd0,11)

and have you a new entry for this partition? The boot message (root-/dev/hda10) looks like you have not , eh?
 
Old 10-20-2003, 07:50 AM   #5
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
I modified it to
root (hd0,11)
kernel /boot/vmliuz-2.4.20-8 ro root=/dev/hda12
initrd /boot/initrd-2.4.20-8.img

root (hd0,11)
kernel /boot/vmliuz-2.4.20-8 ro root=/dev/hda12
initrd /boot/initrd-2.4.20-8.img
FIlesystem type is ext2fs, partition type 0x83
Error 15: FIle not found
still occur.

Last edited by Xiangbuilder; 10-20-2003 at 08:05 AM.
 
Old 10-20-2003, 11:10 AM   #6
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
open teminal type su and root password and then grub

prompt changes to grub>

root (hd0,11) #comment set root for /boot folder
setup #comment put grub into mbr or reload to mbr assuming correct /etc/fstab file
kernel /boot/vmlinuz
initrd /boot/initrd.img
boot

(quits grub command editor)

DIFFERences
spelling of vmlinuz, no mention of read only, no NEED to specify root path as its already done by the ROOT command
and no other stuff in commands.

try that and if it does not work, go to su and type /sbin/lilo to try lilo as a bootloader. Assuming you got /etc/fstab correct as per your first message.
 
Old 10-20-2003, 09:00 PM   #7
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
Thank you.

If I reinstall the grub, I think it must boot the machine.

However, if I don't reinstall the grub and the operating system, I guess I can change the booting files from one partition to another, but I can't change them from one partition to another partition's boot directory. It is my guess, I am not sure about it.

I think if I install grub on mbr and mount a partition, such as /hda13 to the root partition (that is, /) by the mount point, /boot, then, at the booting time, the booting information in mbr will point to /hda13 and find grub/grub.conf (so I have never dared to delete /grub/grub.conf in /hda13), and then, the file grub.conf will find which partition the booting file locate.

I guess there are some other diffrences between the installation, installing the booting files in a single partition and the installation, installing the booting files in root partition's boot directory. A guess too. If no, I think I can achieve it, I posted in the first post.

Here is the content of /etc/fstab

/dev/hda12 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda14 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda6 /equilibrium vfat auto 0 0
/dev/hda7 /free vfat auto 0 0
/dev/hda8 /ghostliness vfat auto 0 0
/dev/hda9 /hda9 ext3 auto 0 0
/dev/hda10 /hda10 ext3 auto 0 0
/dev/hda11 /hda11 ext3 auto 0 0

Thank you.

Last edited by Xiangbuilder; 10-20-2003 at 09:04 PM.
 
Old 10-20-2003, 10:02 PM   #8
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
oops I should read more carefully, /boot is on /dev/hda13 yes?

so replace the root command with

root (hd0,12)

2) what do you mean, by saying you don't want to delete /boot on /dev/hda13?

Does that mean you have not added entries to grub for the other boot ups for your windows stuff?

3) of course you will need to reboot to get grub (or lilo) to find the right kernel or chainloader for windows.

As a rough guess, you may find it easier to use lilo until you read the grub manual.

to replace grub on mbr merely use commands
su (to get root privilege)
when prompted your password
/sbin/lilo

watch some messages for lilo and thats it.

LILO works off a correct /etc/fstab file

Mandrake can add/amend lilo in its control centre I can't help you on how RH does it

I will sneak away
 
Old 10-20-2003, 11:43 PM   #9
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
1) "oops I should read more carefully, /boot is on /dev/hda13 yes?
so replace the root command with
root (hd0,12)"

At the beginning, boot partition is /dev/hda13, I want change the booting files within it to the /dev/hda12/boot directory.

2) "what do you mean, by saying you don't want to delete /boot on /dev/hda13?
Does that mean you have not added entries to grub for the other boot ups for your windows stuff?"

If I don't reinstall grub or the operating system, I think I can't delete some files in /dev/hda13, such as /grub/grub.conf, because MBR will still find these files in /dev/hda13 as before, this can't be changed. However, I can delete some other files in /dev/hda13, such as initrd-2.4.20-8.img and so on. And my trouble is booting for linux instead of Microsoft windows.

Thank you for discussing my problem, your post is helpful to me. Thank you.

Last edited by Xiangbuilder; 10-20-2003 at 11:46 PM.
 
Old 10-22-2003, 01:09 AM   #10
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
Xiangbuilder

post your /boot/messages text file, it shows how grub boots AND post your /etc/lilo.conf (text file) which shows how lilo would do it if ENABLED.

I am still confused on what you mean by /boot and its partitions but if you have booted, ..... the grub file should show me or others.

its not entirely clear in my mind if you meant that you copied all of boot to another partiton because that would mean you have a directory that has /boot /boot /etc /home and so on. (your first post on copying etc)

So to make it explicit can you also write down all directories from root, the command cd / && ls should do it
 
Old 10-22-2003, 01:17 AM   #11
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
Extra

to be sure of your partitions I need this as well in case /etc/fstab is wrong

commands and press enter
su
(when prompted) your password for root
fdisk /dev/hda
You may get a message about cylinder 1024, and whether you do or not then type m for the menu
p (to print table) this is what you will post
q (to quit fdisk without modify
 
Old 10-22-2003, 09:23 PM   #12
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
Quote:
post your /boot/messages text file, it shows how grub boots
There is file /boot/message without extension, I can't see its content, sorry.
Quote:
AND post your /etc/lilo.conf (text file) which shows how lilo would do it if ENABLED.
There isn't the file, /etc/lilo.conf.
Quote:
the grub file should show me or others.
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,12)
#          kernel /vmlinuz-version ro root=/dev/hda12
#          initrd /initrd-version.img
#boot=/dev/hda13
default=0
timeout=10
splashimage=(hd0,12)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
	root (hd0,11)
	kernel /vmlinuz-2.4.20-8 ro root=/dev/hda12
	initrd /initrd-2.4.20-8.img
title Red Flag Linux (2.4.20-8)
	root (hd0,8)
	kernel /vmlinuz-2.4.20-8 ro root=/dev/hda11 vga=785 console=/dev/null CONSOLE=/dev/tty2 acpi=off
	initrd /initrd-2.4.20-8.img
title DOS
	rootnoverify (hd0,0)
	chainloader +1
Quote:
So to make it explicit can you also write down all directories from root, the command cd / && ls should do it
Code:
[root@localhost /]# ls -a
.            etc          lost+found         rootistream.html
..           free         misc               rootostream.html
.autofsck    ghostliness  mnt                sbin
bin          hda10        opt                tmp
boot         hda11        proc               usb
cede         hda9         .recycled          usr
defect       home         root               var
dev          initrd       rootios.html       xiang
equilibrium  lib          rootiostream.html
[root@localhost /]#
[root@localhost /]# fdisk /dev/hda

The number of cylinders for this disk is set to 4866.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       394   3164773+   b  Win95 FAT32
/dev/hda2           395      4866  35921340    f  Win95 Ext'd (LBA)
/dev/hda5           395       788   3164773+   7  HPFS/NTFS
/dev/hda6           789      1182   3164773+   b  Win95 FAT32
/dev/hda7          1183      1970   6329578+   b  Win95 FAT32
/dev/hda8          1971      2758   6329578+   b  Win95 FAT32
/dev/hda9          2759      3152   3164773+  83  Linux
/dev/hda10         3153      3546   3164773+  83  Linux
/dev/hda11         3547      3940   3164773+  83  Linux
/dev/hda12         3941      4822   7084633+  83  Linux
/dev/hda13         4823      4834     96358+  83  Linux
/dev/hda14         4835      4866    257008+  82  Linux swap

Command (m for help): q

[root@localhost /]#
Quote:
I am still confused on what you mean by /boot and its partitions but if you have booted,
Sorry, I don't explain my meaning enough exactly, I try to explain again, hope my words could be clearer than before this time.
When we install a linux operating system, I say, I have two design for it,
design one:
give a single partition for the os, when the installation finished, I get result one;
design two:
don't give a single partition for the os. when the installation finished, I get result two.
At the beginning, I use design one to install the os and get result one,
my question is:
If I don't reinstall grub, mbr, and os, could I convert result one to result two?

Sorry for my poor English, thank you.

Last edited by Xiangbuilder; 10-22-2003 at 09:25 PM.
 
Old 10-23-2003, 01:23 AM   #13
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
ok we are getting somewhere, here are sample lilo and grub files
http://www.mandrakeusers.org/viewtop...764&highlight=

here is the grub doc
http://www.gnu.org/manual/grub-0.92/html_mono/grub.html

If I read you correctly, you are actually trying to find the partition setups for your system whlle still dual booting.

b4 we go any further I STRONGLY recommend you consider an imaging linux program, it can image win95 don't know if it can do the nt stuff.

find it here
www.partimage.org
has online dox and can use cd burners.

So I want you to take an image of each partition for which partimage works using the floppy system or the cd bootable system.

Then we can rebuild your computer any way you like, because when you read grub doc and this grub file
http://www.wlug.org.nz/HowToLinuxWin9xGrubHOWTO
you can install win95/98 on a non-drive 1 partition 1. heh heh heh.

if the above dox are too hard for you we will fall back to a lighter choice, eh?

COMMENTS ON YOUR FILES POSTED

1) lilo conf file not found as you have not attempted to run the command
/sbin/lilo. Your choice, lilo is easier for beginners tho.

2) grub mistakes spotted so far
a) /dev/hda5 appears unbootable from grub, grub can find the chainloader from selecting dos but appears to load a win 95 on hda1 only
b) you will need it use keep grub to add another option to load hda5
c) FIRST rh boot is for hda12 needs /boot folder, assuming you have actually rebooted using hda12 it suggests you have no /boot directory on this partition but instead have vmlinuz and the initrd file immediately below hda12. Now i am likely to be wrong here MDk uses /boot/vm etc but your first install comments after # for RH suggest you can get away without the /boot so I don't know. Can't help.
YOU COULD try root (hd0,11)/boot if you are to miss out the /boot folder structure b4 vmlinuz or initrd.
d) SECOND rh boot not logical, root command says (0,8) = dev/hda9 whereas you claim its hda11. Modify this to match where you know you installed it.
e) Getting back to grub comments on how it was first installed, assuming it worked, your system defined the /boot directory as being on /dev/hda13 I am unfamilar with this command.
f) staying with those comments, it looks like /boot directory was and/or is installed on hda12. YET THAT seems to conflict with your first post. aaahhhh.
g) Can not comment on your directories as such, but at least you have a /boot directory.
h) its not entirely clear to me if you can boot into any linux, are you typing away merrily on windows?

Your use of the word DESIGN make me think you are testing, so if i am wrong sorry.

LILO will only work off a correct /etc/fstab file, assuming it is correct I would recommend the softest option is to make boot disks with lilo, RH dox should tell you how then modify your grub as per my hints
 
Old 10-23-2003, 04:51 AM   #14
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Original Poster
Rep: Reputation: 30
Quote:
a) /dev/hda5 appears unbootable from grub, grub can find the chainloader from selecting dos but appears to load a win 95 on hda1 only
b) you will need it use keep grub to add another option to load hda5
Windows xp is installed on /hda5 and it can be boot well.

Quote:
d) SECOND rh boot not logical, root command says (0,8) = dev/hda9 whereas you claim its hda11. Modify this to match where you know you installed it.
No,
Code:
title Red Flag Linux (2.4.20-8)
	root (hd0,8)
	kernel /vmlinuz-2.4.20-8 ro root=/dev/hda11 vga=785 console=/dev/null CONSOLE=/dev/tty2 acpi=off
	initrd /initrd-2.4.20-8.img
This title is for Red Flag instead of Red Hat, Red Flag is another Linux distribution that is developed by Chinese.
It can be boot at least as well as Windows xp that is on /hda5.
Quote:
f) staying with those comments, it looks like /boot directory was and/or is installed on hda12. YET THAT seems to conflict with your first post. aaahhhh.
I am not sure what are "those comments" you mean. If you mean the line is red, I will explain it for you in my forward post.
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,12)  
#          kernel /vmlinuz-version ro root=/dev/hda12
#          initrd /initrd-version.img
#boot=/dev/hda13
Quote:
g) Can not comment on your directories as such, but at least you have a /boot directory.
I will be very glad if you could explain why I can not comment on your directories as such. thank you.
Quote:
h) its not entirely clear to me if you can boot into any linux, are you typing away merrily on windows?
There are six operating systems in my harddisk, any of them can be boot well, I post all the posts of this thread in Redhat linux.
grub.conf can be modified at the booting time, so it often doesn't matter if the file grub.conf has some errors.
Quote:
Your use of the word DESIGN make me think you are testing, so if i am wrong sorry.
I don't know what words I should say now. Thank you very much, you post a very long post in my thread.
Your post is helpful to me. Thank you.

Last edited by Xiangbuilder; 10-23-2003 at 04:57 AM.
 
Old 10-24-2003, 04:12 AM   #15
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
1) Your first post says you copied /boot from hda13 to hda12. Do you agree you deleted the hda13 reference in your fstab?
2) When you boot into hda12 do you have a /boot folder and the vm and initrd files etc?
3) Assuming you have 4 linux systems which fstab have you booted to print out from? hda9,10,11, or 12?
4) Have you considered editting your grub file with the EDIT commands you are using to boot up?
5) Which hda (NUMBERS) boot without edit?
6) Have a look at my (a) and your previous posts on this issue. Did you notice that not one of your previous attempts shows you
spelt vmlinuz correctly and that you did not have /boot before the vm and init files?


COMMENT
1) I have only just spotted that mdk and rh do not share the same commands eg your rh default=0 versus Mdk default 0
2) your grub conf file appears to have /boot originally at hda13 and / at hda12.
3) create boot disks and test they work for all of your systems b4 trying if you decide not to use partimage

A quick lesson on command ROOT and what / means in the commands may be welcome.

root does not mean / nor does it mean /root . The root command should be spelt boot as its means what partiton do I look for
my vmlinuz etc files and its RELATIVE to that partition that root is meant.

so when you move a /boot folder to hda400........ root (hd0,399) .

when you had hda12 for / and hda13 for /boot root (hdo,12)

you can tell grub RELATIVELY OR ABSOLUTELY where to find stuff.

I notice you tried to define the /boot partiion in a prevous post with
root (hd0,11)/boot
FIlesystem type is ext2fs, partition type 0x83
kernel /boot/vmliuz-2.4.20-8 ro root=/dev/hda10
initrd /boot/initrd-2.4.20-8.img

YOu were almost there except you misunderstood this relative absolute concept of where /boot is. Hence if you used hd0,11 without
the /boot you should have got it in my opinion. But because you had /boot b4 the vm and init files grub was then looking for
/boot/boot/vmlinuz etc?

is that clearer?

LETS TRY THAT ABSOLUTELY to try to confuse you....no gaps between ) and /boot please.

root (hd0,11)
kernel (hd0,11)/boot/vmlinuz-2.4.20-8 ro root=/dev/hda12
initrd (hd0,11)/boot/initrd-2.4.20-8.img


So MY SUGGESTION (A)

title rh (not flag) hda12
root (hd0,11)
kernel /boot/vmlinuz-2.4.20-8 ro root=/dev/hda12
initrd /boot/initrd-2.4.20-8.img

You will need root privilege so type su then when prompted your root password THEN run the command for your editor (I use kwrite)
copy and paste this replacing your current ( hd0,11) entry.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New Parition on existing install chow-stl Slackware - Installation 5 06-28-2005 06:10 AM
Parition question webwolf70 Linux From Scratch 2 09-24-2004 06:01 PM
Help, Linux Parition damaged?? mabs Linux - Software 2 09-14-2004 09:53 AM
Parition resizing compu73rg33k Linux - Software 6 08-21-2004 04:34 PM
Help with NTFS parition cereal83 Slackware 3 07-20-2004 01:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration