Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Harry Putnam writes: > # [HP 12/02/10_18:39:32 > Some discussion of how to use livecd as rescue disk > # ] Sorry .. please disregard... ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
[OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
# [HP 12/02/10_18:39:32 Some discussion of how to use livecd as rescue disk # ] ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Thank Albert Lee who helped me out! Cheers Guy On 12/ 1/10 06:57 PM, Calum Mackay wrote: that sounds good, Guy, zpool import -f -R /a rpool beadm mount /a Yup, that seems like an easier to remember way to do the same thing, nice. thanks, calum. Calum Mackay Oracle Corporation ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
that sounds good, Guy, zpool import -f -R /a rpool beadm mount /a Yup, that seems like an easier to remember way to do the same thing, nice. thanks, calum. Calum Mackay Oracle Corporation ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Calum, Is your procedure: zpool import -f -R /a rpool zfs set mountpoint=/b rpool/ROOT/openindiana zfs mount rpool/ROOT/openindiana cat /a/b/etc/passwd equivalent to the following that works for me from live USB stick (with pfexec or root) zpool import -f -R /a rpool beadm list Choose the installed BE name (which should appear in the list) and then beadm mount /a Then cat /a/a/etc/passwd behaves as you describe (i.e. I can see my username at the end of the file), whereas cat /etc/passwd gives "jack" as the Default user. Likewise I can see other folder/files in the installed filesystem from /a/a When done, beadm unmount Have I missed anything important ? When I reboot my installed OI seems fine. I had to do this for real once when I started with OI in October because of issues with my Nvidia graphics card and the Solaris Nvidia driver (buggy). Cheers Guy ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Frank Middleton writes: > On 11/29/10 10:48, Calum Mackay wrote: >> On 29/11/10 15:34, Frank Middleton wrote: >>> Just a guess, but shouldn't the mountpoint first be set back to "/" >>> >>> zfs umount newrpool/ROOT/openindiana >>> zfs set mountpoint=/ newrpool/ROOT/openindiana >>> zpool export newrpool >> >> I did not find that to be necessary in my own tests... > > Yes, I guess the bootfs property overrides it, and it's incorrect, anyway: > zfs set mountpoint=legacy > but as you say it doesn't seem to make any difference. As a result I > wonder why importing a bootable root pool doesn't mount its root > automatically. Are there any use cases where the current behavior > is useful? A recursive option like import -r might be handy... > >> Also, note the above would likely render the system unbootable, as it >> would leave the pool named as newrpool (as per previous emails). > > Unless it started out life as newrpool :-). > > That is undoubtedly why the OP had the problem... hehe... no, that wasn't it. Being OP, I can say that when I first booted from livecd... I ran zpool import but saw something called xpool. I think I may have meddled around a bit before running that. Can't recall for sure now, but it seems mighty suspicious that the information I was working from on my first attempt mentions xpool in it. I'd say its a good bet I blundered around with zpool and managed to rename rpool to xpool in a frenzy of ill-informed flailing. Also the instructions I was working from was not about recuing rpool but other zpools so I imagine the author use xpool as a generic name. I did not exercise the normal cautions since the OS being rescued was a newly installed vbox oi that I had not done much with yet so no great loss was threatened. If I emerge from this experiment with enough info to do a rescue... I'm a happy camper, even if I did go ahead and just reinstall from livecd rather than keep mucking around, I think I could do a rescue now if need be. ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
On 11/29/10 10:48, Calum Mackay wrote: On 29/11/10 15:34, Frank Middleton wrote: Just a guess, but shouldn't the mountpoint first be set back to "/" zfs umount newrpool/ROOT/openindiana zfs set mountpoint=/ newrpool/ROOT/openindiana zpool export newrpool I did not find that to be necessary in my own tests... Yes, I guess the bootfs property overrides it, and it's incorrect, anyway: zfs set mountpoint=legacy but as you say it doesn't seem to make any difference. As a result I wonder why importing a bootable root pool doesn't mount its root automatically. Are there any use cases where the current behavior is useful? A recursive option like import -r might be handy... Also, note the above would likely render the system unbootable, as it would leave the pool named as newrpool (as per previous emails). Unless it started out life as newrpool :-). That is undoubtedly why the OP had the problem... Cheers -- Frank ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Calum Mackay writes: > On 29/11/10 15:34, Frank Middleton wrote: >> Just a guess, but shouldn't the mountpoint first be set back to "/" >> >> zfs umount newrpool/ROOT/openindiana >> zfs set mountpoint=/ newrpool/ROOT/openindiana >> zpool export newrpool > > I did not find that to be necessary in my own tests... > > Also, note the above would likely render the system unbootable, as it > would leave the pool named as newrpool (as per previous emails). Excellent point. I did reboot a new install with livecd and also found as you did no evidence of an `xpool'. Not sure how that might of crept in first time around... but its a safe bet it was some untoward action on my part. >From livecd, `zpool import' sees rpool from existing install. I can confirm what you noticed. I'd like to try a quick a summary of what the method consists of for booting from livecd for rescue purposes just to see if I'm missing an important step before I commit an outline to my own cvs repo of notes and scripts etc I keep. boot problem os with livecd (for now... openindiana b 147) Once you gotten logged into live cd run: zpool import Just to see what is available. Hopefully you will see the existing rpool with a long ID number associated with it. run (These commands I glommed from Calum M s' posts): zpool import -f -R /a rpool zfs set mountpoint=/b rpool/ROOT/openindiana zfs mount rpool/ROOT/openindiana This is safe because the livecd has no rpool. Now access to the prior install is at /a/b/* Here you will find etc and all the other directories and files from a previous install. Once you've done whatever steps you thought necessary for rescuing the problem OS. Make your escape with: zpool export rpool shutdown, remove the livecd and boot from harddisk...Keeping your fingers crossed that your rescue was effective... but the procedure for getting into position to do rescue work laid out above should not bring grief by itself. ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
On 29/11/10 15:34, Frank Middleton wrote: Just a guess, but shouldn't the mountpoint first be set back to "/" zfs umount newrpool/ROOT/openindiana zfs set mountpoint=/ newrpool/ROOT/openindiana zpool export newrpool I did not find that to be necessary in my own tests... Also, note the above would likely render the system unbootable, as it would leave the pool named as newrpool (as per previous emails). cheers, calum. Oracle Corporation. ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
On 11/27/10 17:14, Calum Mackay wrote: zpool import -f -R /a rpool newrpool zfs set mountpoint=/b newrpool/ROOT/openindiana zfs mount newrpool/ROOT/openindiana ... On 11/29/10 02:57, Harry Putnam wrote: but on reboot I just get a grub prompt. Just a guess, but shouldn't the mountpoint first be set back to "/" zfs umount newrpool/ROOT/openindiana zfs set mountpoint=/ newrpool/ROOT/openindiana zpool export newrpool Cheers -- Frank ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Calum Mackay writes: > To address your current situation, I would try booting the ISO/Live > again, and seeing what "zpool import" says. If it's xpool, or anything > other than rpool, then: > > zpool import -f -R /a badpool rpool > > [where "badpool" is whatever was reported by "zpool import"] > > to rename it to rpool, then try the above steps, or just export and reboot. > > Hopefully that will get you back going again... I did that as posted previously... that is boot livecd, import badpool, export goodpool but on reboot I just get a grub prompt. But I jumped the gun and just started over with a new install. Didn't seem to be going anywhere with my experiment... I believe as you found that it is a working method and that I did something or several somethings, blundering around to cause my own problems. Once I get the new install going... I may try it again just to make sure I can do it. Thanks for your patience and the time you put into answers. ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Harry, I'm not sure what happened in your case, but I've just tried it with a fresh OI b147 install, and it worked perfectly. At no point did I see "xpool". I installed OIb147 in a Vbox VM, using the DVD ISO. Then booted the DVD ISO again, and "zpool import" showed me rpool, as expected. Then: zpool import -f -R /a rpool zfs set mountpoint=/b rpool/ROOT/openindiana zfs mount rpool/ROOT/openindiana cat /a/b/etc/passwd and I could see my personal username in the passwd file, ensuring I was looking at my installed /etc. Then: zpool export rpool and reboot, and it came up perfectly into my install, no issues at all. So this is clearly a usable recovery method, once the mountpoint and mount are done. And perhaps there is a better way to handle that, but it worked for me. To address your current situation, I would try booting the ISO/Live again, and seeing what "zpool import" says. If it's xpool, or anything other than rpool, then: zpool import -f -R /a badpool rpool [where "badpool" is whatever was reported by "zpool import"] to rename it to rpool, then try the above steps, or just export and reboot. Hopefully that will get you back going again... cheers, calum. -- Calum Mackay Oracle Corporation ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
On 28/11/10 15:20, Harry Putnam wrote: OK, rebooted with livecd, imported what was now seen as `newpool' and exported it as rpool rebooted. Still I only get to a grub prompt. No OS login. What does GRUB say if you try to boot? Can you try the findroot function to see if it will find the pool under the various names (rpool, xpool, newrpool)? In fact is there a path to resuce by using the livecd at all, or have I just left out important steps? Well, mine booted fine after I renamed it back (with import) to rpool, but I was using Express b151a, not OI b147. Perhaps that is an important difference... If I get a moment tonight, I'll try it again with OI b147. cheers, calum. (Oracle employee) ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
On 28/11/10 15:20, Harry Putnam wrote: zpool import -f -R /a rpool newrpool The above is what led to eventual problems here: although I could access the files, when I subsequently tried to boot the original system (not the livecd) it couldn't find rpool. That's because my use of newrpool above actually renamed the pool on disk. I had to boot the livecd again and then: zpool import -f -R /a newrpool rpool zpool export rpool to get it renamed back, and then it booted fine. On reflection, I was being too cautious, and that led to trouble. I didn't really need to rename the pool on import, because the livecd doesn't have an rpool setup itself. At least, that's true in my environment, which was using b151a Solaris Express; I didn't have an OI livecd image handy, sorry. Using live-cd build 147: `zpool import' Will report seeing `xpool' with some long ID number. I didn't see that, so presumably that's a recent change between OI and Solaris Express. In this case, the system to be rescued was recently installed from that very live-cd, so maybe that would lesson the likelyhood of problems? Yes, I think I just made problems for myself with the rename on import. Do it without that, i.e. do it as you had been doing it, but with the added mount, and all should be fine. My test system recovered perfectly fine once I correctly the renamed pool. let us know how you get on. cheers, calum. (Oracle employee) ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
Calum Mackay writes: > On 27/11/10 22:14, Calum Mackay wrote: >> If not, I got it to work here, something like this: > > Mind you, the above may not be wise: if you import your real rpool > into the livecd, that may end up leaving the rpool in a state where it > won't look right to the "real" environment... [i.e. previously used on > a different system] > > So I'd test it on a disposable system before you do it for real... Thanks. This is a test system, and installed from the very livecd I'm hoping to rescue it with. Oh, your formula did work here too. I was leaving out the final `mount' and still expecting to see files gack. > zpool import -f -R /a rpool newrpool > zfs set mountpoint=/b newrpool/ROOT/openindiana > zfs mount newrpool/ROOT/openindiana Yup, that formula works. Although I will add that apparently A zpool seen by livecd is apparently labeled xpool by default. Using live-cd build 147: `zpool import' Will report seeing `xpool' with some long ID number. If your warnings about changing files and later having the rpool give problems when booted under the `real' environment are true then it seems a bit weird that one can find so many references to rescuing a system with the live-cd. `Can the live-cd actually be used in that way safely?' That is something I'd really like to know... if you cannot change anything for fear of later having troubles, how is a rescue to be done? In this case, the system to be rescued was recently installed from that very live-cd, so maybe that would lesson the likelyhood of problems? Thanks for you input... I will know shortly, I hope, what the outcome is. - - --=-- - --- - What follows is a report of troubles apparently arising from importing rpool, just as you warned. A sorry tail of woe . No real harm has been done since it is a test system, only a fair bit of time lost. - - --=-- - --- - Well it was not good. (Preface with saying this is a virutal system running thru vbox, host is windows 7) I wanted to edit out something I had added to /etc/profile that I suspect caused the OS not to work properly. I suspected it was from my edit in /etc/profile which was the last thing I remembered doing that changed any files. After initial install from live-cd b 147 and after setting up the home directories of user and root, I noticed that opening an xterm always opened in / (root) instead of $HOME for $USER. I checked that the $HOME envo variable was known... when a fresh xterm was opened and it was, echo $HOME showed the expected output. I could not figure out why then, the xterms always were in `/' when opened. Perhaps `/home' was not mounted... but it was I could see: and navigate to /export/home/myuser I edited /etc/profile to tell any logging in user to cd to $HOME but also added an echo, hoping it would show in the opened xterm so I'd know that /etc/profile was getting read. Something like: echo "/etc/profile was read" cd $HOME in /etc/profile. And it seemed to work so far as causing a fresh xterm to open on $HOME rather than `/'. All hunky dory until I rebooted. I don't recall now what happened exactly but it would not boot. So naturally I figured my edit in /etc/profile was the problem. I suspected having output from /etc/profile was upsetting something. - - --=-- - --- - I rebooted with livecd , imported and mounted what had been rpool with the forumula posted in this thread, edited etc/profile and rebooted. Now I get only a grub prompt... no OS login. OK, I thought OOOPS I probably should have exported the renamed rpool back out as rpool. OK, rebooted with livecd, imported what was now seen as `newpool' and exported it as rpool rebooted. Still I only get to a grub prompt. No OS login. I've forgotten the incantations for grub to get booted but anyway what has happened? How to understand what is going on? In fact is there a path to resuce by using the livecd at all, or have I just left out important steps? ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
On 27/11/10 22:14, Calum Mackay wrote: If not, I got it to work here, something like this: Mind you, the above may not be wise: if you import your real rpool into the livecd, that may end up leaving the rpool in a state where it won't look right to the "real" environment... [i.e. previously used on a different system] So I'd test it on a disposable system before you do it for real... cheers, calum. (Oracle employee) ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
Re: [OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
On 27/11/10 21:15, Harry Putnam wrote: zpool import -f -R /a xpool xpool/ROOT/openindiana3.82G 11.7G 3.72G /a/b As you see, the files that matter, those under /etc are not available anywhere under /a From the import command I should be able to see /a/xpool/ROOT I think you'll find it under /a/b, no? If not, I got it to work here, something like this: zpool import -f -R /a rpool newrpool zfs set mountpoint=/b newrpool/ROOT/openindiana zfs mount newrpool/ROOT/openindiana ls /a/b/etc and I could see the files. hope this helps. cheers, calum. (Oracle employee) ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss
[OpenIndiana-discuss] livecd zpool import -fR /a xpool but no files
I'm having trouble trying to use the livecd for oi to get the existing rpool mounted and accessable. I've booted with livecd build 147 zpool import -f -R /a xpool Gives me: zpool list NAMESIZE ALLOC FREECAP DEDUP HEALTH ALTROOT xpool 17.9G 4.94G 12.9G27% 1.00x ONLINE /a And zfs list -r xpool zfs list -r xpool NAME USED AVAIL REFER MOUNTPOINT xpool 5.88G 11.7G31K /a/xpool xpool/ROOT3.82G 11.7G31K /a/a xpool/ROOT/openindiana3.82G 11.7G 3.72G /a/b xpool/dump1023M 11.7G 1023M - xpool/export95K 11.7G32K /a/export xpool/export/home 63K 11.7G32K /a/export/home xpool/export/home/reader31K 11.7G31K /a/export/home/reader xpool/swap1.06G 12.7G 124M - As you see, the files that matter, those under /etc are not available anywhere under /a From the import command I should be able to see /a/xpool/ROOT But no soap. So how does one get at the files under rpool from a live cd? ___ OpenIndiana-discuss mailing list OpenIndiana-discuss@openindiana.org http://openindiana.org/mailman/listinfo/openindiana-discuss