Discussion:
[OpenIndiana-discuss] mounting an existing system on a boot image
Marc Lobelle
2018-09-10 08:54:16 UTC
Permalink
Hello,

by doing a wrong chmod in /etc (I thought I was in another directory) I
made /etc/init and thus /sbin/init not executable, so the system does
not boot anymore even in single user.

Thus I booted a live image from a DVD and I would like to mount my root
file sustem on this image in order to fix the permissions in /sbin and
/usr/sbin

In old solaris versions, as far as I remember there was even a menu
entry for this.

But I do not know how to do it now with zfs from the live image. I'm
running the live image in gui mode.

Could somebody help me with this ?

Thanks


Marc
Jonathan Adams
2018-09-10 09:10:58 UTC
Permalink
https://askubuntu.com/questions/56792/how-to-copy-only-file-attributes-metadata-without-actual-content-of-the-file

--

#!/bin/bash
# Filename: cp-metadata

myecho=echo
src_path="$1"
dst_path="$2"

find "$src_path" |
while read src_file; do
dst_file="$dst_path${src_file#$src_path}"
$myecho chmod --reference="$src_file" "$dst_file"
$myecho chown --reference="$src_file" "$dst_file"
$myecho touch --reference="$src_file" "$dst_file"
done

--

YMMV


On Mon, 10 Sep 2018 at 09:54, Marc Lobelle <***@uclouvain.be>
wrote:

> Hello,
>
> by doing a wrong chmod in /etc (I thought I was in another directory) I
> made /etc/init and thus /sbin/init not executable, so the system does
> not boot anymore even in single user.
>
> Thus I booted a live image from a DVD and I would like to mount my root
> file sustem on this image in order to fix the permissions in /sbin and
> /usr/sbin
>
> In old solaris versions, as far as I remember there was even a menu
> entry for this.
>
> But I do not know how to do it now with zfs from the live image. I'm
> running the live image in gui mode.
>
> Could somebody help me with this ?
>
> Thanks
>
>
> Marc
>
>
> _______________________________________________
> openindiana-discuss mailing list
> openindiana-***@openindiana.org
> https://openindiana.org/mailman/listinfo/openindiana-discuss
>
Udo Grabowski (IMK)
2018-09-10 09:21:13 UTC
Permalink
On 10/09/2018 10:54, Marc Lobelle wrote:
> Hello,
>
> by doing a wrong chmod in /etc (I thought I was in another directory) I made
> /etc/init and thus /sbin/init not executable, so the system does not boot
> anymore even in single user.
>
> Thus I booted a live image from a DVD and I would like to mount my root file
> sustem on this image in order to fix the permissions in /sbin and /usr/sbin
>
> In old solaris versions, as far as I remember there was even a menu entry for this.
>
> But I do not know how to do it now with zfs from the live image. I'm running the
> live image in gui mode.
>
> Could somebody help me with this ?
>

Either 'zpool import -f rpool' or 'beadm mount rpool /a' should
do that (verify with 'zpool import' or 'beadm list' beforehand).
--
Dr.Udo Grabowski Inst.f.Meteorology & Climate Research IMK-ASF-SAT
http://www.imk-asf.kit.edu/english/sat.php
KIT - Karlsruhe Institute of Technology http://www.kit.edu
Postfach 3640,76021 Karlsruhe,Germany T:(+49)721 608-26026 F:-926026
Jean-Pierre
2018-09-10 09:22:09 UTC
Permalink
Marc Lobelle wrote:
> Hello,
>
> by doing a wrong chmod in /etc (I thought I was in another directory) I
> made /etc/init and thus /sbin/init not executable, so the system does
> not boot anymore even in single user.
>
> Thus I booted a live image from a DVD and I would like to mount my root
> file sustem on this image in order to fix the permissions in /sbin and
> /usr/sbin
>
> In old solaris versions, as far as I remember there was even a menu
> entry for this.
>
> But I do not know how to do it now with zfs from the live image. I'm
> running the live image in gui mode.

From a live DVD/USB (beware of the keyboard layout) :

zpool import -f rpool
mkdir /tmp/a
[beadm list] if needed
beadm mount openindiana /tmp/a
* make the needed modifications on /tmp/a
beadm unmount openindiana
zpool export rpool


>
> Could somebody help me with this ?
>
> Thanks
>
>
> Marc
Marc Lobelle
2018-09-10 09:55:17 UTC
Permalink
Thanks Udo and Jean Pierre: a small detail:I must be root to do this: where can I find the root pwd of the live image ?
Marc
________________________________________
De : Jean-Pierre [jean-***@wanadoo.fr]
Envoyé : lundi 10 septembre 2018 11:22
À : openindiana-***@openindiana.org
Objet : Re: [OpenIndiana-discuss] mounting an existing system on a boot image

Marc Lobelle wrote:
> Hello,
>
> by doing a wrong chmod in /etc (I thought I was in another directory) I
> made /etc/init and thus /sbin/init not executable, so the system does
> not boot anymore even in single user.
>
> Thus I booted a live image from a DVD and I would like to mount my root
> file sustem on this image in order to fix the permissions in /sbin and
> /usr/sbin
>
> In old solaris versions, as far as I remember there was even a menu
> entry for this.
>
> But I do not know how to do it now with zfs from the live image. I'm
> running the live image in gui mode.

From a live DVD/USB (beware of the keyboard layout) :

zpool import -f rpool
mkdir /tmp/a
[beadm list] if needed
beadm mount openindiana /tmp/a
* make the needed modifications on /tmp/a
beadm unmount openindiana
zpool export rpool


>
> Could somebody help me with this ?
>
> Thanks
>
>
> Marc
Udo Grabowski (IMK)
2018-09-10 09:57:35 UTC
Permalink
On 10/09/2018 11:55, Marc Lobelle wrote:
> Thanks Udo and Jean Pierre: a small detail:I must be root to do this: where can I find the root pwd of the live image ?

sudo bash
echo $PWD


--
Dr.Udo Grabowski Inst.f.Meteorology & Climate Research IMK-ASF-SAT
http://www.imk-asf.kit.edu/english/sat.php
KIT - Karlsruhe Institute of Technology http://www.kit.edu
Postfach 3640,76021 Karlsruhe,Germany T:(+49)721 608-26026 F:-926026
Till Wegmüller
2018-09-10 10:02:53 UTC
Permalink
Hi

Small info for problems such as these.

pkg has the functionality builtin to fix them

So with board tools you only need to boot a live/install iso drop to
shell. and then.

zpool import -R /a rpool
pkg -R /a verify
pkg -R /a fix
zpool export rpool

And your done :)

Hope this helps
Greetings
Till

On 9/10/18 11:57 AM, Udo Grabowski (IMK) wrote:
> On 10/09/2018 11:55, Marc Lobelle wrote:
>> Thanks Udo and Jean Pierre: a small detail:I must be root to do this:
>> where can I find the root pwd of the live image ?
>
> sudo bash
> echo $PWD
>
>
Udo Grabowski (IMK)
2018-09-10 10:05:15 UTC
Permalink
On 10/09/2018 11:57, Udo Grabowski (IMK) wrote:
> On 10/09/2018 11:55, Marc Lobelle wrote:
>> Thanks Udo and Jean Pierre: a small detail:I must be root to do this: where
>> can I find the root pwd of the live image ?
>
> sudo bash
> echo $PWD

:-) just mocking, there usually is no password for root, its just
a role, you have to sudo from the jack account. On a production
system, you can change that deleting the /etc/user_attr type=role
entry for root (or using the -R options for usermod) and setting
a passwd.
--
Dr.Udo Grabowski Inst.f.Meteorology & Climate Research IMK-ASF-SAT
http://www.imk-asf.kit.edu/english/sat.php
KIT - Karlsruhe Institute of Technology http://www.kit.edu
Postfach 3640,76021 Karlsruhe,Germany T:(+49)721 608-26026 F:-926026
Alan Coopersmith
2018-09-10 15:29:25 UTC
Permalink
On 09/10/18 02:55 AM, Marc Lobelle wrote:
> Thanks Udo and Jean Pierre: a small detail:I must be root to do this: where can I find the root pwd of the live image ?

On the live cd, root's password should be "solaris".

--
-Alan Coopersmith- ***@oracle.com
Oracle Solaris Engineering - https://blogs.oracle.com/alanc
Apostolos Syropoulos via openindiana-discuss
2018-09-10 15:45:27 UTC
Permalink
It is openindiana. This is not Oracle Solaris.
Regards,
Apostolos
Alan Coopersmith
2018-09-10 16:13:44 UTC
Permalink
On 09/10/18 08:45 AM, Apostolos Syropoulos via openindiana-discuss wrote:
> It is openindiana. This is not Oracle Solaris.

Sorry, thought I was responding to the ***@yahoo list. Must drink
more caffiene before answering mail on Monday morning...

-alan-
James
2018-09-10 09:25:34 UTC
Permalink
On 10/09/2018 09:54, Marc Lobelle wrote:

> Thus I booted a live image from a DVD and I would like to mount my root
> file sustem on this image in order to fix the permissions in /sbin and
> /usr/sbin

"zpool import ..." is what you need. I'm assuming you can solve this
now yourself by reading the documentation and examples.


James.
Continue reading on narkive:
Loading...