public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Moving root
@ 2002-03-19  1:52 Fuper
  2002-03-20  4:15 ` [gentoo-dev] Further observations on moving root Fuper
  0 siblings, 1 reply; 4+ messages in thread
From: Fuper @ 2002-03-19  1:52 UTC (permalink / raw
  To: gentoo-dev

Tomorrow I'm taking the LPI 101 certification exam but tonight I'm feeling
stupid because I'm not sure how to move the root partition under Gentoo
Linux.  It's the devfs that confuses me.  

I replicated the / partition onto a new SCSI partition using 
   star -c /etc | star -x -C /mnt/partition
and so forth.  I replicated /dev this same way.

Of course I edited the /etc/fstab file on the new root.

when I first booted the new partition I noticed a message
at the end, after executing my /etc/runlevels/default/local
script, complaining that
   cat:  mounts  # no such file or directory
I looked at /sbin/rc and saw there that it contains a line
to "cat mounts" which I changed to "cat /proc/mounts".
The error message is no longer produced, but in 
checking the mounted filesystems I see that I now have
a "new" filesystem that I didn't have before.  I.e.
# df -h
   /dev/sdb1    471M   153M   293M   35%   /
   none           471M    153M  293M   35%  /dev

What the heck is this "none" device mounted at /dev??

Q:  is the "cat mounts" command in /sbin/rc an error?
Q:  how should I properly populate /dev on a new 
    root partition?
Q:  what can explain the "none" filesystem mounted
   at my new /dev

[I'm still booting the old root partition until I understand
what's going on]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] Further observations on moving root
  2002-03-19  1:52 [gentoo-dev] Moving root Fuper
@ 2002-03-20  4:15 ` Fuper
  2002-03-20 17:55   ` Martin Schlemmer
  0 siblings, 1 reply; 4+ messages in thread
From: Fuper @ 2002-03-20  4:15 UTC (permalink / raw
  To: gentoo-dev

If you ever might add a new disk drive and want to move the Gentoo
root partition onto the new (maybe faster) drive then my struggles
in doing that may be relevant to you.  Copying the partition didn't
just work --- I found that the /dev directory initialization was not
obvious.

I did conclude to my own satisfaction that the /sbin/rc script (v. 1.16) 
is in error at line 312 and should read as follows:
   309  #we want devfsd running after a change of runlevel (if we return
   310  #from runlevel 'single')
   311  if [ -z "$(ps -A | grep devfsd)" ] && \
   312     [ -n "$(cat /proc/mounts | grep -e '/dev devfs')" ]
   313  then
   314          /sbin/devfsd /dev &>/dev/null
   315  fi
The distributed script had "cat mounts" and failed when devfsd
was not already running.

After reading the devfs FAQ and Robbins paper on devfs at 
IBM:developerWorks I concluded that a cleanly built root
partition should have an empty /dev directory.  It is entirely
populated by devfs when that is "mounted" and accessed.

BUT Gentoo linux, installed from build rc6 r14, crashes when
booted from the same /boot partition but using a new root ("/")
and an empty /dev (it had more interesting problems when 
I attempted to create a fully populated dev/ by copying the
in-use /dev from the old root partition onto the new partition
s.a.
   star -c /dev | star -x -C /mnt/partition  # Don't do this

I had to add the devfs mount option to the kernel so that
the grub commands that had been
  root (hd0,0)
  kernel /boot/bzImage root=/dev/hda2 hdc=ide-scsi
became now
  root (hd0,0)
  kernel /boot/bzImage root=/dev/sdb1 hdc=ide-scsi devfs=mount

It is a mystery to me why it now becomes necessary to add
the devfs=mount option to the grub kernel command, booting
the same kernel using the same devfs.conf file and same 
root partition (but copied onto a new disk).  If this is obvious
to everyone else, then so be it; but maybe it is worth 
documenting that under some conditions it becomes
necessary to add the kernel option.

I hope that this is helpful.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] Further observations on moving root
  2002-03-20  4:15 ` [gentoo-dev] Further observations on moving root Fuper
@ 2002-03-20 17:55   ` Martin Schlemmer
  2002-03-20 19:10     ` Christian HOFFMANN
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Schlemmer @ 2002-03-20 17:55 UTC (permalink / raw
  To: Gentoo-Dev

On Wed, 2002-03-20 at 06:15, Fuper wrote:
> If you ever might add a new disk drive and want to move the Gentoo
> root partition onto the new (maybe faster) drive then my struggles
> in doing that may be relevant to you.  Copying the partition didn't
> just work --- I found that the /dev directory initialization was not
> obvious.
> 
> I did conclude to my own satisfaction that the /sbin/rc script (v. 1.16) 
> is in error at line 312 and should read as follows:
>    309  #we want devfsd running after a change of runlevel (if we return
>    310  #from runlevel 'single')
>    311  if [ -z "$(ps -A | grep devfsd)" ] && \
>    312     [ -n "$(cat /proc/mounts | grep -e '/dev devfs')" ]
>    313  then
>    314          /sbin/devfsd /dev &>/dev/null
>    315  fi
> The distributed script had "cat mounts" and failed when devfsd
> was not already running.
> 
> After reading the devfs FAQ and Robbins paper on devfs at 
> IBM:developerWorks I concluded that a cleanly built root
> partition should have an empty /dev directory.  It is entirely
> populated by devfs when that is "mounted" and accessed.
> 
> BUT Gentoo linux, installed from build rc6 r14, crashes when
> booted from the same /boot partition but using a new root ("/")
> and an empty /dev (it had more interesting problems when 
> I attempted to create a fully populated dev/ by copying the
> in-use /dev from the old root partition onto the new partition
> s.a.
>    star -c /dev | star -x -C /mnt/partition  # Don't do this
> 
> I had to add the devfs mount option to the kernel so that
> the grub commands that had been
>   root (hd0,0)
>   kernel /boot/bzImage root=/dev/hda2 hdc=ide-scsi
> became now
>   root (hd0,0)
>   kernel /boot/bzImage root=/dev/sdb1 hdc=ide-scsi devfs=mount
> 
> It is a mystery to me why it now becomes necessary to add
> the devfs=mount option to the grub kernel command, booting
> the same kernel using the same devfs.conf file and same 
> root partition (but copied onto a new disk).  If this is obvious
> to everyone else, then so be it; but maybe it is worth 
> documenting that under some conditions it becomes
> necessary to add the kernel option.
> 

This is because /sbin/init needs /dev/initctl, and as we dropped
the initwrapper that created that if not existing, it fails when
a unmounted /dev do not contain it.

> I hope that this is helpful.
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
-- 

Martin Schlemmer
Gentoo Linux Developer, Desktop Team Developer
Cape Town, South Africa




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] Further observations on moving root
  2002-03-20 17:55   ` Martin Schlemmer
@ 2002-03-20 19:10     ` Christian HOFFMANN
  0 siblings, 0 replies; 4+ messages in thread
From: Christian HOFFMANN @ 2002-03-20 19:10 UTC (permalink / raw
  To: gentoo-dev

Hello,

I recently moved my root partition from one disk to the other and 
experienced the same problem with /dev.

My solution is actualy simple, i did a mount /dev/hda3 /mnt/gentoo 
(hda3 being my old root partition) and moved the hard drive content 
with a tar cf | tar xfp from /mnt/gentoo to the new root. Working that 
way, I copied the actual hard drive file not the dynamic filesystems in 
/dev and /proc.

I worked without any problem, I'm also using this trick to backup my 
system in a way similar of what is described in D.Robbins tutorial on 
devlopperworks.

Regards

> On Wed, 2002-03-20 at 06:15, Fuper wrote:
> > If you ever might add a new disk drive and want to move the Gentoo
> > root partition onto the new (maybe faster) drive then my struggles
> > in doing that may be relevant to you.  Copying the partition didn't
> > just work --- I found that the /dev directory initialization was not
> > obvious.
> > 
> > I did conclude to my own satisfaction that the /sbin/rc script (v. 1.16) 
> > is in error at line 312 and should read as follows:
> >    309  #we want devfsd running after a change of runlevel (if we return
> >    310  #from runlevel 'single')
> >    311  if [ -z "$(ps -A | grep devfsd)" ] && \
> >    312     [ -n "$(cat /proc/mounts | grep -e '/dev devfs')" ]
> >    313  then
> >    314          /sbin/devfsd /dev &>/dev/null
> >    315  fi
> > The distributed script had "cat mounts" and failed when devfsd
> > was not already running.
> > 
> > After reading the devfs FAQ and Robbins paper on devfs at 
> > IBM:developerWorks I concluded that a cleanly built root
> > partition should have an empty /dev directory.  It is entirely
> > populated by devfs when that is "mounted" and accessed.
> > 
> > BUT Gentoo linux, installed from build rc6 r14, crashes when
> > booted from the same /boot partition but using a new root ("/")
> > and an empty /dev (it had more interesting problems when 
> > I attempted to create a fully populated dev/ by copying the
> > in-use /dev from the old root partition onto the new partition
> > s.a.
> >    star -c /dev | star -x -C /mnt/partition  # Don't do this
> > 
> > I had to add the devfs mount option to the kernel so that
> > the grub commands that had been
> >   root (hd0,0)
> >   kernel /boot/bzImage root=/dev/hda2 hdc=ide-scsi
> > became now
> >   root (hd0,0)
> >   kernel /boot/bzImage root=/dev/sdb1 hdc=ide-scsi devfs=mount
> > 
> > It is a mystery to me why it now becomes necessary to add
> > the devfs=mount option to the grub kernel command, booting
> > the same kernel using the same devfs.conf file and same 
> > root partition (but copied onto a new disk).  If this is obvious
> > to everyone else, then so be it; but maybe it is worth 
> > documenting that under some conditions it becomes
> > necessary to add the kernel option.
> > 
> 
> This is because /sbin/init needs /dev/initctl, and as we dropped
> the initwrapper that created that if not existing, it fails when
> a unmounted /dev do not contain it.
> 
> > I hope that this is helpful.
> > _______________________________________________
> > gentoo-dev mailing list
> > gentoo-dev@gentoo.org
> > http://lists.gentoo.org/mailman/listinfo/gentoo-dev
> -- 
> 
> Martin Schlemmer
> Gentoo Linux Developer, Desktop Team Developer
> Cape Town, South Africa
> 
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
> 

-------------------------------------------
Christian HOFFMANN <hoffmann@noos.fr>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-03-20 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-19  1:52 [gentoo-dev] Moving root Fuper
2002-03-20  4:15 ` [gentoo-dev] Further observations on moving root Fuper
2002-03-20 17:55   ` Martin Schlemmer
2002-03-20 19:10     ` Christian HOFFMANN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox