View previous topic :: View next topic |
Author |
Message |
Gentree Watchman
Joined: 01 Jul 2003 Posts: 5350 Location: France, Old Europe
|
Posted: Thu Jul 07, 2005 4:02 pm Post subject: getting rooted by chroot |
|
|
Very strange behaviour from chroot.
A few months back I started to set up a ~x86 system on a separte partition. I got it bootable but udev was not functional and I only got /dev/hda.... etc from mount
I dropped it for a while , in the mean time I changed my hard disks to one large one.
My main system has been migrated no probs from the old /dev/hdc .... to /dev/hda...
Stable for months full udev.
Code: | bash-3.00#mount
/dev/hda5 on / type reiserfs (rw,noatime,notail)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw)
/dev/hda8 on /suse type reiserfs (rw,notail)
/dev/hda3 on /boot type ext3 (rw,noatime)
/dev/hda11 on /wine type ext3 (rw)
/dev/hda12 on /home type ext3 (rw)
/dev/hda14 on /iso type reiserfs (rw,noatime)
/dev/hda15 on /tmpd type reiser4 (rw,noatime)
/dev/hda16 on /rar type ext3 (rw)
/dev/hda18 on /dvclone type reiserfs (rw,notail)
/dev/hda10 on /devsys type reiser4 (rw,noatime)
/dev/hda6 on /usr/portage type reiser4 (rw,noatime)
/usr/portage on /devsys/usr/portage type none (rw,bind)
none on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
ls /dev/hd*
/dev/hda /dev/hda11 /dev/hda14 /dev/hda17 /dev/hda3 /dev/hda6 /dev/hda9
/dev/hda1 /dev/hda12 /dev/hda15 /dev/hda18 /dev/hda4 /dev/hda7 /dev/hdd
/dev/hda10 /dev/hda13 /dev/hda16 /dev/hda2 /dev/hda5 /dev/hda8
|
Now I am rebulding /devsys using gcc4. OK most of it builds no probs.
Now if I chroot /devsys and do mount :
Code: | bash-3.00#mount
/dev/hdc11 on / type reiser4 (rw,noatime)
proc on /proc type proc (rw,nodiratime)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw)
|
Bullshit !
/dev/hdc does not even exist any more . It IDE and power cables are pulled out !
Now let's look at /devsys/etc/fstab
Code: | bash-3.00#grep hdc /devsys/etc/fstab
#hdc13:
#hdc15:
#/dev/hdc3 /boot ext3 noatime 0 2
#hdc12:
#hdc10,5,6,7.8.9
#hdc14: |
So any ref to /dev/hdc is in the form of comments: there are no partitions set to dev/hdcx
now what IS defined and should be used on chroot.
Code: |
bash-3.00#grep hda /devsys/etc/fstab
/dev/hda10 / reiser4 noatime 0 0
/dev/hda5 /newsys reiserfs
.... |
Now it seems to be dredging up some historical fstab from somewhere
/devsys/etc/conf.d/rc has RC_TARBALL="no"
Can anyone see what is evading me?
TIA Gentree. _________________ Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86 |
|
Back to top |
|
|
Nil_Spaar Apprentice
Joined: 10 Jul 2004 Posts: 179 Location: Berlin, Germany
|
Posted: Thu Jul 07, 2005 5:50 pm Post subject: |
|
|
During the installation one has to copy some file from /proc to /etc/mtab. And before doing this mount shows strange stuff while chrooted.
It's a wild guess but could that be related? |
|
Back to top |
|
|
GenTimJS Guru
Joined: 03 May 2003 Posts: 406 Location: NH, USA
|
Posted: Thu Jul 07, 2005 7:27 pm Post subject: |
|
|
not using any ide cable select sillyness i hope? _________________ -Tim Smith |
|
Back to top |
|
|
widan Veteran
Joined: 07 Jun 2005 Posts: 1512 Location: Paris, France
|
Posted: Thu Jul 07, 2005 7:41 pm Post subject: |
|
|
Nil_Spaar wrote: | During the installation one has to copy some file from /proc to /etc/mtab. And before doing this mount shows strange stuff while chrooted.
It's a wild guess but could that be related? |
It probably is...
Code: | melanie ~ # echo "/dev/somedevice /mnt/somewhere gentoofs rw 0 0" >> /etc/mtab
melanie ~ # mount | grep gentoofs
/dev/somedevice on /mnt/somewhere type gentoofs (rw)
(remove the line)
melanie ~ # mount | grep gentoofs
melanie ~ # |
/devsys/etc/mtab is probably an old version, as mtab is updated only when (u)mount is run. And probably the last time it was updated was the last time you ran the ~x86 system (EDIT: not in a chroot). |
|
Back to top |
|
|
Gentree Watchman
Joined: 01 Jul 2003 Posts: 5350 Location: France, Old Europe
|
Posted: Fri Jul 08, 2005 6:08 am Post subject: |
|
|
That was indeed the problem , a dead old bit if mtab lying around from when I last booted on the other disk. Significantly this was also messing up booting to that partition directly.
I though /etc/mtab got created clean on each boot , it appears not !
I may file a bug on this since I see no functional reason why stale info should be left in mtab
As you said , it seems it is only mount/umount that modifies it so it looks like the last shutdown on the old disk was not clean and left some entried in mtab.
I deleted the file rebooted directly and all is well now.
Thanks for your suggestions in clearing this up.
_________________ Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86 |
|
Back to top |
|
|
|
|
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
|
|