LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-24-2011, 03:30 AM   #1
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 738

Rep: Reputation: 29
Grub2, moving /boot to separate partition


I would like to move /boot from sda4 (where / is) to sda1.
how to do that with Grub2 on Debian Testing?
thanks.
 
Old 10-24-2011, 05:08 AM   #2
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
The easiest would be with a live cd and as root from terminal

mount partition sda1 with /mnt/sda1

and run command

grub-install --boot-directory=/mnt/sda1 /mnt/sda
 
1 members found this post helpful.
Old 10-24-2011, 05:40 AM   #3
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 738

Original Poster
Rep: Reputation: 29
thanks.
hm, but why would I need to do it from live CD?
can't it be done from sda4?
 
Old 10-24-2011, 06:49 AM   #4
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Here is a good tutorial that I refer to that will explain both ways.

grub2

Last edited by Larry Webb; 10-24-2011 at 06:53 AM.
 
Old 10-24-2011, 01:01 PM   #5
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 738

Original Poster
Rep: Reputation: 29
well I failed. forgot to modify /boot/grub/grub.cfg

I found an interesting tutorial here for old grub: http://tekguru.wordpress.com/2007/09...own-partition/

if I simply modify the grub.cfg like he did menu.lst , would it work?
 
Old 10-24-2011, 02:25 PM   #6
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Yes but if you run update-grub it will change grub.cfg back plus any changes in distros that you have made. When I install grub2 to a separate partition I make my own grub.cfg and then disable os-prober. One easy way is to copy your grub.cfg from the installed linux distro and paste it in your new /boot/grub partition.

I chainload my partitions so I find it easier to build my own grub.cfg.
 
Old 10-25-2011, 01:23 AM   #7
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 738

Original Poster
Rep: Reputation: 29
hm, could update-grub automagically find sda1 partition (that has only /boot on it) and add it to grub.cfg ?
I don't understand how the system knows where / is after the commands from /boot finish.

does single menu item in grub.cfg contain both locations of /boot and / ?
 
Old 10-25-2011, 02:28 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
No, the code "knows" where it was installed from - based on the parameters passed to (or defaulted) the grub-install.
After doing the grub-install from the "old" configuration you need to update fstab for the new /boot, reboot or remount /boot to sda1, then (re-)run the update-grub. Things should then all be pointing in the correct direction(s).
 
1 members found this post helpful.
Old 10-25-2011, 11:33 AM   #9
qrange
Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian
Posts: 738

Original Poster
Rep: Reputation: 29
it seems I used grub-install on wrong partition.
in the end, I followed chroot method and it works.

edit: funny thing is now I have /boot/boot/grub
perhaps that was the problem.

Last edited by qrange; 10-25-2011 at 11:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] grub2 indirect booting from separate partition Larry Webb Linux - General 9 12-19-2010 12:35 PM
Moving /home dir to separate partition before 7.10 install Thane Ubuntu 2 10-11-2007 06:18 PM
Problem moving /var to separate partition a550ee Linux - Newbie 6 10-02-2007 03:09 PM
[SOLVED] Moving /boot to separate partition and using 'grub' to boot eldiener Linux - General 4 11-28-2006 08:01 PM
Moving contents of /var to separate partition TexasDex Linux - Software 2 03-01-2004 08:30 PM


All times are GMT -5. The time now is 04:50 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration