Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-10 Thread Johannes Rosenberger
On 05.02.2017 08:34, J. Roeleveld wrote:
> On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
>> Hi,
>>
>> since my old Gentoo installation seems to be screwed up (regarding
>> the update process) beyond repair I decided to install a new one
>> instead of waiting for help.
>>
>> I already made space at a certain of my harddisk and installed the
>> stage3 there.
>> Chrooting is one of the first steps to check, whether what I have
>> done so is valid.
>>
>> But before deleting the old root and install the new one at its
>> place I would like to do a atmost identical boot into the new
>> root.
>>
>> As far as I know the kernel only allows to boot into a partition
>> (instead of a directory on a partition containing the root
>> installation) and I am still using devices to boot from instead
>> of GPT.
>>
>> Is there any neat trick to do a real boot into the new root via
>> the normal boot process (grub2) nevertheless ?
>>
>> Cheers
>> Meino
> If I understand correctly. The answer is no. (Unless you write some clever 
> initramfs)
>
> Afaik, the kernel takes the entire partition and mounts it at '/'. If you 
> want it to use a directory (which would then be at '/newinstall') you need to 
> get the kernel to chroot into that directory and run init in there.
>
> Only option I see is to use an extra disk. Maybe a USB drive and use that.
>
> --
> Joost


Hi!

If I understand correctly, the answer is YES! You even needn't write an
initramfs, although that wouldn't have to be very clever: An initramfs
simply loads the necessary kernel modules for mounting the root
partition, mounts it and in the end does this:

exec switch_root   

The manpage for switch_root says that  must be the root of a
mount and gives a trick for mounting arbitrary dirs: Just run a 'mount
--bind  ' before.
So, assuming your system is installed to /newinstall, you can just place
the following shell script  in e.g.  /newinstall/switch_root.sh:

#!/bin/sh

ROOT=/newinstall

mount --bind "$ROOT" "$ROOT"
exec switch_root "$ROOT" /sbin/init

#EOF

Then run 'chmod +x /newinstall/switch_root.sh'.

Now you add 'init=/newinstall/switch_root.sh' to your kernel commandline
(grub.cfg) and just boot  ist.
If you have some esoteric mount setup and need to use fstab in the
initramfs, then it is probably better to do it in an initramfs. I can
post a link to some easy initramfs setup, if you like. I'd need to
comment mine a bit so that everybody understands why I do what.

I haven't tried this specific script but have once created my own
initramfs for a special btrfs setup with some subvolumes.
If you try this, please let me know if it works!

Sorry for replying so late, i sent this mail last Sunday but from the
wrong email address. So it was probably dropped.


Cheers

Johannes





Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread Neil Bothwick
On Sun, 05 Feb 2017 09:26:27 +, Mick wrote:

> Regarding booting off a directory, have a look at booting ISO images
> with GRUB.  I would think a similar approach should allow you to boot
> from a directory instead of an ISO image.

That's only possible because the ISO images have support for it in their
init scripts, so you're back to needing an initramfs to do it.


-- 
Neil Bothwick

Hard work has a future payoff. Laziness pays off now.


pgpQ2kLJDBBal.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread Meino . Cramer
J. Roeleveld  [17-02-05 11:28]:
> On Sunday, February 5, 2017 10:43:21 AM CET meino.cra...@gmx.de wrote:
> > Mick  [17-02-05 10:36]:
> > > On Sunday 05 Feb 2017 10:13:09 meino.cra...@gmx.de wrote:
> 
> > The last time I used star it kills my filesystem. It mau be the most
> > POSIX compliant thing of the universe...but...
> > Its long ago...I never have touched this again...
> > 
> > I will check the grub thingy...good idea! :)
> 
> If you figure that one out, please share.
> I would love to know how to do that.
> 
> > Currentlu I am totally blocked from build a new system, since
> > gcc has stopped working globally.
> 
> I have this occasionally. Run:
> # gcc-config -l
> 
> Usually the first on in that list is the one you want. Which would be set 
> with:
> # gcc-config 1
> 
> And then correct your profile:
> # source /etc/profile
> 
> And try emerge again :)
> 
> --
> Joost
> 
> 
> 

Hi Joost,

the problem was a superflous "," in the make.conf-file which screwed
up some later stages of the whole process.

I am still setting up the system...you...compiling the world is the
gentooist daily bussiness ;)

So it may take some time till I try the grub thing.
If I find a way (or a valid info that it will definetly NOT work) 
I will post it here (this thread or a separate one).

Cheers
Meino





Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread J. Roeleveld
On Sunday, February 5, 2017 10:43:21 AM CET meino.cra...@gmx.de wrote:
> Mick  [17-02-05 10:36]:
> > On Sunday 05 Feb 2017 10:13:09 meino.cra...@gmx.de wrote:

> The last time I used star it kills my filesystem. It mau be the most
> POSIX compliant thing of the universe...but...
> Its long ago...I never have touched this again...
> 
> I will check the grub thingy...good idea! :)

If you figure that one out, please share.
I would love to know how to do that.

> Currentlu I am totally blocked from build a new system, since
> gcc has stopped working globally.

I have this occasionally. Run:
# gcc-config -l

Usually the first on in that list is the one you want. Which would be set with:
# gcc-config 1

And then correct your profile:
# source /etc/profile

And try emerge again :)

--
Joost





Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread Meino . Cramer
Mick  [17-02-05 10:36]:
> On Sunday 05 Feb 2017 10:13:09 meino.cra...@gmx.de wrote:
> > J. Roeleveld  [17-02-05 10:04]:
> > > On Sunday, February 5, 2017 9:46:53 AM CET meino.cra...@gmx.de wrote:
> > > > J. Roeleveld  [17-02-05 08:44]:
> > > > > On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
> > > > > >Hi,
> > > > > >
> > > > > >since my old Gentoo installation seems to be screwed up (regarding
> > > > > >the update process) beyond repair I decided to install a new one
> > > > > >instead of waiting for help.
> > > > > >
> > > > > >I already made space at a certain of my harddisk and installed the
> > > > > >stage3 there.
> > > > > >Chrooting is one of the first steps to check, whether what I have
> > > > > >done so is valid.
> > > > > >
> > > > > >But before deleting the old root and install the new one at its
> > > > > >place I would like to do a atmost identical boot into the new
> > > > > >root.
> > > > > >
> > > > > >As far as I know the kernel only allows to boot into a partition
> > > > > >(instead of a directory on a partition containing the root
> > > > > >installation) and I am still using devices to boot from instead
> > > > > >of GPT.
> > > > > >
> > > > > >Is there any neat trick to do a real boot into the new root via
> > > > > >the normal boot process (grub2) nevertheless ?
> > > > > >
> > > > > >Cheers
> > > > > >Meino
> > > > > 
> > > > > If I understand correctly. The answer is no. (Unless you write some
> > > > > clever
> > > > > initramfs)
> > > > > 
> > > > > Afaik, the kernel takes the entire partition and mounts it at '/'. If
> > > > > you
> > > > > want it to use a directory (which would then be at '/newinstall') you
> > > > > need to get the kernel to chroot into that directory and run init in
> > > > > there.
> > > > > 
> > > > > Only option I see is to use an extra disk. Maybe a USB drive and use
> > > > > that.
> > > > > 
> > > > > --
> > > > > Joost
> > > > 
> > > > Hi Joost,
> > > > 
> > > > thanks fpr your posting! :)
> > > > 
> > > > Ok...another USB drive mau lay around here...will see...
> > > > Just two quick questions:
> > > > 
> > > > Is this ok, to preserve as much as possible of the
> > > > settings/attributes/whatever of the files or do you anything better
> > > > and quickier than this:
> > > > (cd /. ; tar cf - . ) | ( cd /. ; tar xvpsf - )
> > > > ?
> > > 
> > > Don't forget to add the permissions on the source side:
> > > 
> > > tar --xattrs -cvpf .
> > > And maybe also add "--xattrs" on the target side.
> > > 
> > > Other options:
> > > # rsync (not fully certain about options)
> > > # cd  ; cp -a  .
> > > 
> > > I never did any timing, but logic tells me using the "cp" option is
> > > quicker
> > > (as it is all on the same system)
> > > 
> > > --
> > > Joost
> > 
> > THANKS! for the correction of the commandline, Joost!!!
> > 
> > While copying I am always on the same system ... it is just another
> > subdirectory from the copuing process's perspective (or I miss
> > the point here totally...still doing below my normal coffee level
> > currentlu ;)
> > 
> > I think rsync becomes speedy for updates...only...?
> > 
> > Cheers
> > Meino
> 
> Also have a look at app-arch/star.
> 
> Regarding booting off a directory, have a look at booting ISO images with 
> GRUB.  I would think a similar approach should allow you to boot from a 
> directory instead of an ISO image.
> -- 
> Regards,
> Mick

Thanks for the infos, Mick! 

The last time I used star it kills my filesystem. It mau be the most
POSIX compliant thing of the universe...but...
Its long ago...I never have touched this again...

I will check the grub thingy...good idea! :)

Currentlu I am totally blocked from build a new system, since
gcc has stopped working globally.

Will see...

Cheers
Meino





Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread Mick
On Sunday 05 Feb 2017 10:13:09 meino.cra...@gmx.de wrote:
> J. Roeleveld  [17-02-05 10:04]:
> > On Sunday, February 5, 2017 9:46:53 AM CET meino.cra...@gmx.de wrote:
> > > J. Roeleveld  [17-02-05 08:44]:
> > > > On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
> > > > >Hi,
> > > > >
> > > > >since my old Gentoo installation seems to be screwed up (regarding
> > > > >the update process) beyond repair I decided to install a new one
> > > > >instead of waiting for help.
> > > > >
> > > > >I already made space at a certain of my harddisk and installed the
> > > > >stage3 there.
> > > > >Chrooting is one of the first steps to check, whether what I have
> > > > >done so is valid.
> > > > >
> > > > >But before deleting the old root and install the new one at its
> > > > >place I would like to do a atmost identical boot into the new
> > > > >root.
> > > > >
> > > > >As far as I know the kernel only allows to boot into a partition
> > > > >(instead of a directory on a partition containing the root
> > > > >installation) and I am still using devices to boot from instead
> > > > >of GPT.
> > > > >
> > > > >Is there any neat trick to do a real boot into the new root via
> > > > >the normal boot process (grub2) nevertheless ?
> > > > >
> > > > >Cheers
> > > > >Meino
> > > > 
> > > > If I understand correctly. The answer is no. (Unless you write some
> > > > clever
> > > > initramfs)
> > > > 
> > > > Afaik, the kernel takes the entire partition and mounts it at '/'. If
> > > > you
> > > > want it to use a directory (which would then be at '/newinstall') you
> > > > need to get the kernel to chroot into that directory and run init in
> > > > there.
> > > > 
> > > > Only option I see is to use an extra disk. Maybe a USB drive and use
> > > > that.
> > > > 
> > > > --
> > > > Joost
> > > 
> > > Hi Joost,
> > > 
> > > thanks fpr your posting! :)
> > > 
> > > Ok...another USB drive mau lay around here...will see...
> > > Just two quick questions:
> > > 
> > > Is this ok, to preserve as much as possible of the
> > > settings/attributes/whatever of the files or do you anything better
> > > and quickier than this:
> > > (cd /. ; tar cf - . ) | ( cd /. ; tar xvpsf - )
> > > ?
> > 
> > Don't forget to add the permissions on the source side:
> > 
> > tar --xattrs -cvpf .
> > And maybe also add "--xattrs" on the target side.
> > 
> > Other options:
> > # rsync (not fully certain about options)
> > # cd  ; cp -a  .
> > 
> > I never did any timing, but logic tells me using the "cp" option is
> > quicker
> > (as it is all on the same system)
> > 
> > --
> > Joost
> 
> THANKS! for the correction of the commandline, Joost!!!
> 
> While copying I am always on the same system ... it is just another
> subdirectory from the copuing process's perspective (or I miss
> the point here totally...still doing below my normal coffee level
> currentlu ;)
> 
> I think rsync becomes speedy for updates...only...?
> 
> Cheers
> Meino

Also have a look at app-arch/star.

Regarding booting off a directory, have a look at booting ISO images with 
GRUB.  I would think a similar approach should allow you to boot from a 
directory instead of an ISO image.
-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread Dale
J. Roeleveld wrote:
> On Sunday, February 5, 2017 9:46:53 AM CET meino.cra...@gmx.de wrote:
>> J. Roeleveld  [17-02-05 08:44]:
>>> On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
 Hi,

 since my old Gentoo installation seems to be screwed up (regarding
 the update process) beyond repair I decided to install a new one
 instead of waiting for help.

 I already made space at a certain of my harddisk and installed the
 stage3 there.
 Chrooting is one of the first steps to check, whether what I have
 done so is valid.

 But before deleting the old root and install the new one at its
 place I would like to do a atmost identical boot into the new
 root.

 As far as I know the kernel only allows to boot into a partition
 (instead of a directory on a partition containing the root
 installation) and I am still using devices to boot from instead
 of GPT.

 Is there any neat trick to do a real boot into the new root via
 the normal boot process (grub2) nevertheless ?

 Cheers
 Meino
>>> If I understand correctly. The answer is no. (Unless you write some clever
>>> initramfs)
>>>
>>> Afaik, the kernel takes the entire partition and mounts it at '/'. If you
>>> want it to use a directory (which would then be at '/newinstall') you
>>> need to get the kernel to chroot into that directory and run init in
>>> there.
>>>
>>> Only option I see is to use an extra disk. Maybe a USB drive and use that.
>>>
>>> --
>>> Joost
>> Hi Joost,
>>
>> thanks fpr your posting! :)
>>
>> Ok...another USB drive mau lay around here...will see...
>> Just two quick questions:
>>
>> Is this ok, to preserve as much as possible of the
>> settings/attributes/whatever of the files or do you anything better
>> and quickier than this:
>> (cd /. ; tar cf - . ) | ( cd /. ; tar xvpsf - )
>> ?
> Don't forget to add the permissions on the source side:
>
> tar --xattrs -cvpf . 
> And maybe also add "--xattrs" on the target side.
>
> Other options:
> # rsync (not fully certain about options)
> # cd  ; cp -a  .
>
> I never did any timing, but logic tells me using the "cp" option is quicker 
> (as it is all on the same system)
>
> --
> Joost
>

I've moved my OS from one drive to another a few times.  I use cp -av
and let her rip.  It takes a while but I tried the tar way and guess
what, it took a while too.  It just seems to add one more step. 

Good advice. 

Dale

:-)  :-) 



Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread Meino . Cramer
J. Roeleveld  [17-02-05 10:04]:
> On Sunday, February 5, 2017 9:46:53 AM CET meino.cra...@gmx.de wrote:
> > J. Roeleveld  [17-02-05 08:44]:
> > > On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
> > > >Hi,
> > > >
> > > >since my old Gentoo installation seems to be screwed up (regarding
> > > >the update process) beyond repair I decided to install a new one
> > > >instead of waiting for help.
> > > >
> > > >I already made space at a certain of my harddisk and installed the
> > > >stage3 there.
> > > >Chrooting is one of the first steps to check, whether what I have
> > > >done so is valid.
> > > >
> > > >But before deleting the old root and install the new one at its
> > > >place I would like to do a atmost identical boot into the new
> > > >root.
> > > >
> > > >As far as I know the kernel only allows to boot into a partition
> > > >(instead of a directory on a partition containing the root
> > > >installation) and I am still using devices to boot from instead
> > > >of GPT.
> > > >
> > > >Is there any neat trick to do a real boot into the new root via
> > > >the normal boot process (grub2) nevertheless ?
> > > >
> > > >Cheers
> > > >Meino
> > > 
> > > If I understand correctly. The answer is no. (Unless you write some clever
> > > initramfs)
> > > 
> > > Afaik, the kernel takes the entire partition and mounts it at '/'. If you
> > > want it to use a directory (which would then be at '/newinstall') you
> > > need to get the kernel to chroot into that directory and run init in
> > > there.
> > > 
> > > Only option I see is to use an extra disk. Maybe a USB drive and use that.
> > > 
> > > --
> > > Joost
> > 
> > Hi Joost,
> > 
> > thanks fpr your posting! :)
> > 
> > Ok...another USB drive mau lay around here...will see...
> > Just two quick questions:
> > 
> > Is this ok, to preserve as much as possible of the
> > settings/attributes/whatever of the files or do you anything better
> > and quickier than this:
> > (cd /. ; tar cf - . ) | ( cd /. ; tar xvpsf - )
> > ?
> 
> Don't forget to add the permissions on the source side:
> 
> tar --xattrs -cvpf . 
> And maybe also add "--xattrs" on the target side.
> 
> Other options:
> # rsync (not fully certain about options)
> # cd  ; cp -a  .
> 
> I never did any timing, but logic tells me using the "cp" option is quicker 
> (as it is all on the same system)
> 
> --
> Joost
> 
> 

THANKS! for the correction of the commandline, Joost!!!

While copying I am always on the same system ... it is just another
subdirectory from the copuing process's perspective (or I miss
the point here totally...still doing below my normal coffee level
currentlu ;)

I think rsync becomes speedy for updates...only...?

Cheers
Meino









Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread J. Roeleveld
On Sunday, February 5, 2017 9:46:53 AM CET meino.cra...@gmx.de wrote:
> J. Roeleveld  [17-02-05 08:44]:
> > On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
> > >Hi,
> > >
> > >since my old Gentoo installation seems to be screwed up (regarding
> > >the update process) beyond repair I decided to install a new one
> > >instead of waiting for help.
> > >
> > >I already made space at a certain of my harddisk and installed the
> > >stage3 there.
> > >Chrooting is one of the first steps to check, whether what I have
> > >done so is valid.
> > >
> > >But before deleting the old root and install the new one at its
> > >place I would like to do a atmost identical boot into the new
> > >root.
> > >
> > >As far as I know the kernel only allows to boot into a partition
> > >(instead of a directory on a partition containing the root
> > >installation) and I am still using devices to boot from instead
> > >of GPT.
> > >
> > >Is there any neat trick to do a real boot into the new root via
> > >the normal boot process (grub2) nevertheless ?
> > >
> > >Cheers
> > >Meino
> > 
> > If I understand correctly. The answer is no. (Unless you write some clever
> > initramfs)
> > 
> > Afaik, the kernel takes the entire partition and mounts it at '/'. If you
> > want it to use a directory (which would then be at '/newinstall') you
> > need to get the kernel to chroot into that directory and run init in
> > there.
> > 
> > Only option I see is to use an extra disk. Maybe a USB drive and use that.
> > 
> > --
> > Joost
> 
> Hi Joost,
> 
> thanks fpr your posting! :)
> 
> Ok...another USB drive mau lay around here...will see...
> Just two quick questions:
> 
> Is this ok, to preserve as much as possible of the
> settings/attributes/whatever of the files or do you anything better
> and quickier than this:
> (cd /. ; tar cf - . ) | ( cd /. ; tar xvpsf - )
> ?

Don't forget to add the permissions on the source side:

tar --xattrs -cvpf . 
And maybe also add "--xattrs" on the target side.

Other options:
# rsync (not fully certain about options)
# cd  ; cp -a  .

I never did any timing, but logic tells me using the "cp" option is quicker 
(as it is all on the same system)

--
Joost




Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-05 Thread Meino . Cramer
J. Roeleveld  [17-02-05 08:44]:
> On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
> >Hi,
> >
> >since my old Gentoo installation seems to be screwed up (regarding
> >the update process) beyond repair I decided to install a new one
> >instead of waiting for help.
> >
> >I already made space at a certain of my harddisk and installed the
> >stage3 there.
> >Chrooting is one of the first steps to check, whether what I have
> >done so is valid.
> >
> >But before deleting the old root and install the new one at its
> >place I would like to do a atmost identical boot into the new
> >root.
> >
> >As far as I know the kernel only allows to boot into a partition
> >(instead of a directory on a partition containing the root
> >installation) and I am still using devices to boot from instead
> >of GPT.
> >
> >Is there any neat trick to do a real boot into the new root via
> >the normal boot process (grub2) nevertheless ?
> >
> >Cheers
> >Meino
> 
> If I understand correctly. The answer is no. (Unless you write some clever 
> initramfs)
> 
> Afaik, the kernel takes the entire partition and mounts it at '/'. If you 
> want it to use a directory (which would then be at '/newinstall') you need to 
> get the kernel to chroot into that directory and run init in there.
> 
> Only option I see is to use an extra disk. Maybe a USB drive and use that.
> 
> --
> Joost
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
> 

Hi Joost,

thanks fpr your posting! :)

Ok...another USB drive mau lay around here...will see...
Just two quick questions:

Is this ok, to preserve as much as possible of the
settings/attributes/whatever of the files or do you anything better
and quickier than this:
(cd /. ; tar cf - . ) | ( cd /. ; tar xvpsf - )
?

Cheers
Meino





Re: [gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-04 Thread J. Roeleveld
On February 5, 2017 6:26:27 AM GMT+01:00, meino.cra...@gmx.de wrote:
>Hi,
>
>since my old Gentoo installation seems to be screwed up (regarding
>the update process) beyond repair I decided to install a new one
>instead of waiting for help.
>
>I already made space at a certain of my harddisk and installed the
>stage3 there.
>Chrooting is one of the first steps to check, whether what I have
>done so is valid.
>
>But before deleting the old root and install the new one at its
>place I would like to do a atmost identical boot into the new
>root.
>
>As far as I know the kernel only allows to boot into a partition
>(instead of a directory on a partition containing the root
>installation) and I am still using devices to boot from instead
>of GPT.
>
>Is there any neat trick to do a real boot into the new root via
>the normal boot process (grub2) nevertheless ?
>
>Cheers
>Meino

If I understand correctly. The answer is no. (Unless you write some clever 
initramfs)

Afaik, the kernel takes the entire partition and mounts it at '/'. If you want 
it to use a directory (which would then be at '/newinstall') you need to get 
the kernel to chroot into that directory and run init in there.

Only option I see is to use an extra disk. Maybe a USB drive and use that.

--
Joost
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



[gentoo-user] A new gentoo ... how to check before delete the old one?

2017-02-04 Thread Meino . Cramer
Hi,

since my old Gentoo installation seems to be screwed up (regarding
the update process) beyond repair I decided to install a new one
instead of waiting for help.

I already made space at a certain of my harddisk and installed the
stage3 there.
Chrooting is one of the first steps to check, whether what I have
done so is valid.

But before deleting the old root and install the new one at its
place I would like to do a atmost identical boot into the new
root.

As far as I know the kernel only allows to boot into a partition
(instead of a directory on a partition containing the root
installation) and I am still using devices to boot from instead
of GPT.

Is there any neat trick to do a real boot into the new root via
the normal boot process (grub2) nevertheless ?

Cheers
Meino