[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: BUSY BOX after boot attempt..



	 On Thu, 11 Sep 2008 00:52:30 +0300
		 Andrei Popescu <andreimpopescu@gmail.com> wrote:

> On Wed,10.Sep.08, 14:24:07, Jack Schneider wrote:
> 
> > Thanks, Andrei for the response.  Checked out #s and yes they have
> > changed.  
> > So I need some further guidance... "In case of any doubt use labels."
> > Any pointers to an appropriate "howto"????       Question 2 What's the
> > impact on FSTAB settings?
>  
> Here's a (very quick) howto:
> 
> * use e2label to create labels for all your partition:
> 
> e2label /dev/hdaX root_part
> 
> (where 'root_part' is the label for the root partition and /dev/hdaX is 
> the device name of the root partition. Use whatever naming scheme you 
> want).
> 
> * edit /boot/grub/menu.lst and change the line
> 
> # kopt=root=/dev/hda5 ro (other boot options)
> 
> to
> 
> # kopt=root=LABEL=root_part ro (other boot options)
> 
> * also edit the stanza that you will boot and replace 'root=/dev/hda5' 
>   with 'root=LABEL=root_part'
> 
> * edit /etc/fstab and change all references to the device (/dev/hda5, 
>   ...) with LABEL={label}
> 
> * reboot
> 
> * run /usr/sbin/update-grub to regenerate /boot/grub/menu.lst to use the 
>   label everywhere.
> 
> Regards,
> Andrei


Hope the attached file helps. Commentary is appreciated, even expected ;-)

Title: "Changing mounts in fstab and GRUB boot to LABEL from dev."
Author: Abel McClendon  hcmmac@clearwire.net
Copyright:
"Caveat emptor (Law), let the purchaser beware, i. e.,
 let him examine the article he is buying, and act on his
 own judgment.
 [1913 Webster]"
Substitute "reader" for "purchaser" above. - Author.
Substitute "reading" or "using" for "buying" above. - Author.
##
Copyright (C) 2008  Abel McClendon

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
##


Table of Contents:
1. Preface
2. Physical disk(s) must be labeled.
3. File /etc/fstab must be changed.
4. File /boot/grub/menu.lst must be changed.
5. Backup existing files, place new files, run update-grub, reboot at your
   leisure.
6. References and credits.

Preface :
Regularly hard disk device names may change ( e.g. from sdc to sdh to sdb
etc). When this happens it possible a system will not boot. This document
applies to Debian GNU/Linux with ext2/ext3 file systems. This document does one
thing: It describes the procedure used to change mounting in /etc/fstab from
/dev/hda1 to LABEL=lenny and make changes to GRUB survive reboot. It does not
go into discussion of the merits of LABEL vs. UUID, security, usefulness, or
anything else.


2. Physical disk(s) must be labeled.

Careful selection of a label naming convention is required because future
changes in devices in the system and or moving devices between systems may
cause problems.

Some devices (partitions) may already be labeled. e2label will tell. Here,
pasted directly from the terminal, are the results of using e2label. First
command is to see if a label exists. Second command is to do the labeling.
Third command is to check whether the labeling took place.

as root, partitions mounted :
--code

  # e2label /dev/hda1

  # e2label /dev/hda1 lenny
  # e2label /dev/hda1
  lenny
  #

--end code

Lather,rinse,repeat as physical partitions and or devices on your system may
differ. Of course change the new-label,lenny in this case, with name(s) of your
choice.

references:
man e2label

http://www.math.ias.edu/doc/e2fsprogs-1.35/RELEASE-NOTES
"The ext2 library has been enhanced to make tune2fs safe to run on
mounted file systems.  (Users could usually get away with using tune2fs
on mounted file systems before, but with the advent of ext3 and
journaling, it became important to make tune2fs was *really* safe for
use even when the file system being modified is mounted.)  E2label is
now implemented by tune2fs using an argv[0] dispatch, so that e2label
is also now safe for use on mounted file systems."


3. File /etc/fstab must be changed.

This procedure insures a good backup to restore and a sane, safe place for
editing.

as root:
--code

  #cp /etc/fstab ~/misc/dev-to-label/fstab.dev
  #cp ~/misc/dev-vs-label/fstab.dev ~/misc/dev-to-label/fstab.label
  #pico ~/misc/dev-to-label/fstab.label
  #diff fstab.dev fstab.label
  5c5
  < /dev/hda1	/		ext3	errors=remount-ro	0	1
  ---
  > LABEL=lenny	/		ext3	errors=remount-ro	0	1

--end code

Lather,rinse,repeat as physical partitions and or devices on your system
may differ. Of course changing the new_label, lenny in this case, with name(s)
of your choice.

references:
man cp
man fstab
man pico
man diff


4. File /boot/grub/menu.lst must be changed.

Edited /boot/grub/menu.lst producing this using a similar procedure as above to
copy the files into the working directory. Just change the kopt line,
update-grub will do the rest for you.

as root:
--code

  # diff menu.lst.dev menu.lst.label
  62c62
  < # kopt=root=/dev/hda1 ro
  ---
  > # kopt=root=LABEL=lenny ro vga=792
  #

--end code

references:
man grub
man update-grub
man bootparam
the 'default' menu.lst file.


5. Backup existing files, place new files, run update-grub, reboot at your
   leisure.


as root:
--code

  #mv /etc/fstab /etc/fstab.dev.good
  #cp ~/misc/dev-to-label/fstab.label /etc/fstab
  #mv /boot/grub/menu.lst /boot/grub/menu.lst.dev.good
  #cp ~/misc/dev-to-label/menu.lst.label /boot/grub/menu.lst
  #update-grub
  #

--end code

Reboot at your leisure.

references:
man mv
man update-grub

6. References and credits.
man - the program man
http://lists.debian.org/debian-user/2008/08/msg00808.html
http://www.math.ias.edu/doc/e2fsprogs-1.35/RELEASE-NOTES
http://shiny.thorne.id.au/2008/02/i-have-been-doing-lot-of-hacking-with.html
http://csciwww.etsu.edu/nielsen/4417/grub-partitions-labels.txt
http://www.debian-administration.org/articles/522
http://wiki.debian.org/DebianInstaller/Discussion
irc channel #debian on OFTC.

Attachment: signature.asc
Description: PGP signature


Reply to: