LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 11-23-2005, 06:16 PM   #1
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
How easy is it to move an installed Solaris partition around?


Is it possible to move an installed Solaris Express say from hda4 to hdd1. I need to turn the hda4 primary into an extended partition for more logical partitions for other purpose.

In Linux I could dd the source to a target if I keep both partitions identical in size. I could change the reference of the partition to be booted by the boot loader and the fstab file. Most of the time this will work in Linux.

Just wonder if Solaris can tolerate such a move?

Last edited by saikee; 11-23-2005 at 06:17 PM.
 
Old 11-24-2005, 04:32 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
This should work the same way as Linux.
 
Old 11-24-2005, 06:05 AM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398

Original Poster
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
jlliagre

That sounds great!

Still finding my way around Solaris as I couldn't find the equivalent Linux commands for

fdisk -l.

Also the Solaris Express has Grub and I can boot it from a floppy by calling its kernel and module but there doesn't seem to be a Grub shell that I can instruct Grub to replicate its boot loader. Can one build Grub within Solaris the same way as in a Linux?
 
Old 11-24-2005, 06:38 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Still finding my way around Solaris as I couldn't find the equivalent Linux commands for

fdisk -l.
There's no direct equivalent, but
Code:
fdisk -W - /dev/rdsk/c0d0p0
Will give you some information about primary partitions, and
Code:
prtvtoc /dev/rdsk/c0d0s2
information about slices inside the Solaris partition.

Quote:
Also the Solaris Express has Grub and I can boot it from a floppy by calling its kernel and module but there doesn't seem to be a Grub shell that I can instruct Grub to replicate its boot loader. Can one build Grub within Solaris the same way as in a Linux?
I've not that much experience with grub, please explain with more details how you would do it with Linux.
 
Old 11-24-2005, 07:11 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398

Original Poster
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Detail of how to build Grub in a Linux

Grub Manual Appendix A

It is quite a simple task as I have done it a few times.

If Grub is available then typing Grub can invoke a Grub shell.

grub-install /dev/hda will place the Grub boot loader into hda disk. I would imagine for Solaris hda may have to change to c0d0.

There is evidence that the latest version of Grub 0.97 is inside Solaris Express.

--------------------

Grub can be installed onto a floppy (see Chapter 3.1 of Grub Manual on how to make one, the Linux can be come from a Live CD like Mepis) unattached to an operating system.

That floppy allow me to boot any system in a PC, as long as each system has a boot loader inside its root partition. The manual booting in such a case is generic by 3 lines

root (hdi,j) <--------telling Grub the root is in jth partition of the ith disk (Grub counts from 0!)
chainloader +1 <--------telling Grub to boot the boot loader of root (hdi,j)
boot <---------Green light for Grub to proceed

In chainloading Grub does not boot the system. It boot the system's boot loader. That is why Grub has been so successfull. It simply cuts up itself, throws away everything except its first 512 bytes and pastes its first 512 bytes at the +1 position (or the 2nd sector) of the another boot loader.

Without the boot loader installed inside the root partition the system can still be booted directly by Grub naming its kernel and module.

When booting Solaris Express manually with a floppy, just follow the instructions of /boot/grub/menu.lst.
 
Old 11-24-2005, 08:59 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Solaris grub is based on 0.95, source is available at
http://cvs.opensolaris.org/source/xref/on/usr/src/grub/

The grub command is there.

To install the mbr, here's the command:
Code:
/sbin/installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0
 
Old 11-24-2005, 06:22 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398

Original Poster
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Thanks for the tip. Will investigate
 
Old 01-11-2007, 03:00 PM   #8
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by jlliagre
Solaris grub is based on 0.95, source is available at
http://cvs.opensolaris.org/source/xref/on/usr/src/grub/

The grub command is there.

To install the mbr, here's the command:
Code:
/sbin/installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0

I saw many bad (non-working) examples of this since I just installed OpenSolaris and it uses grub. I am multibooting a few other systems on this same box. The FreeBSD installation (probably the worst of any installer I've ever seen btw) overwrote the MBR with its own boot loader after I selected "Do not install a boot loader". I used LILO to boot everything but I wanted to learn grub. I had the grub menu figured out pretty quickly, but I could not see how to put grub back in the MBR. Sun had a FAQ but it (and the man page for grub if you can find the right one) is full of recursive definitions.

Your example worked perfectly on my Solaris 10 system. Thank you for being so helpful to the Solaris community!

It would be nice if there was some grub doc which explained the whole process in normal terms like what stage1 and stage2 mean. The man page (for installgrub) says:

stage1 the name of the GRUB stage 1 file

Somebody needs a good a$$-kicking!
 
Old 01-11-2007, 03:28 PM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398

Original Poster
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Actually stage1 is the the first 512 bytes that the Bios always reads when instructed to search for a booting system from a hard disk.

I believe every boot loader has a similar stage-1 and the one used by the MS system is the common MBR restorable by a floppy or the Windows installation CD. It is a well know fact MS's equivalent stage-1 searches from the 4 primaries and boots the one with the booting flag switched on.

The stage2 is the actual intelligence and the one that does all the work because stage1's job is just to load the stage2. However it is noteworthy to point out the stage1 does carry the partition table which would be integrated with the stage1 in the memory.

I believe every boot loader has these two stages and the way Grub manages to boot all other PC systems is by retaining its stage1 in the memory and "paste" with the stage2 of whatever boot loader of the system to be booted. In other word

Grub boots a BSD ---> Grub stage1 + BSD's boot loader stage2 in the memory

Grub boots a Windows ---> Grub stage1 + Windows boot loader stage2 in the memory

Grub boots a Linux (Lilo) ----> Grub stage1 + Lilo stage2 in the memory.

Grub just goes into the root directory of that system, starting from the "+1" position or the 2nd sector and load the whatever inside the boot sector.

The difference between Grub and the other boot loaders is that Grub does it in a generic way whereas most other boot loaders are designed to serve only one master and therefore no need for explanation.

I think it is a recent phenomenon that computing power, ram chip, hard disk space and computer hardware in general become affordable making it possible to have operable multi systems in a PC. The boot loaders are now having a good fortune enjoying good business.
 
Old 01-11-2007, 04:31 PM   #10
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
thanks, Saikee (King Of Booting!)

I understand the two-stage idea of boot loading. The main thing is that there isn't enough room in the MBR for complete booting code so it jumps to the secondary bootloader on the partition superblock.

But it is confusing to try to understand why you have to specify stage1 stage2 for Grub and not for Lilo..also these files actually seem to exist on the grub host and since I didn't go through all the steps of setting this up (default Solaris installation) I don't get why all these pieces are all over the place or how they got there.

Since you were foolish enough to help out (as usual) maybe you will be willing to answer another question. I am planning on installing Solaris on another multiboot box that is running with LILO in the MBR. How do I get rid of grub in Solaris's superblock and just boot directly with LILO? I notice when I chainload Solaris with LILO I still get the grub menu.

Thanks,
Rand

I still think I like lilo better (a lot better) than grub but I have to admit the grub command shell is pretty nice. Lilo still seems a lot easier and more direct.

Last edited by Randux; 01-11-2007 at 04:33 PM.
 
Old 01-11-2007, 05:19 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398

Original Poster
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Hey I am just an old newbie trying to learn a few tricks from the masters.

I haven't gone much into Solaris up to now but started my interest in it again.

My guess is Lilo should be able to boot Solaris just like it does with a Windows and the Grub in the superblock of Solaris doesn't really matter at all. I guess if Solaris is in the hda3 for example then Lilo should be able to boot it by
Code:
other=/dev/hda3
label=Solaris
I know Lilo doesn't trust us and it will go inside the /dev/hda3 to check and make sure there is a boot loader with which it can pass the control to. Whether Lilo cam manage to do this I really don't know but I shall have a go at it some time.

Grub has made it clear that it supports the Solarius filing system and can go inside its partition to grab its kernel for loading into the memory.

------------------------------------------------------------------
Edited addition

Just tried out booting Solaris Express with Lilo 22.7.2 provided by Wolvix.

Managed to compiled alright by adding Solaris but Lilo couldn't boot and came back with the message
Code:
boot : Solaris
booting Solaris
Boot error
and it hangs.

I actually got Solaris Express in hda3 and the Lilo statements are exactly as the above.

Wolvix boots satisfactorily and I could fire up Solaris by a Grub floppy (to get a Grub prompt) with commands
Code:
root (hd0,2)
chainloader +1
boot

Last edited by saikee; 01-11-2007 at 06:34 PM.
 
Old 01-12-2007, 06:34 AM   #12
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Hi Saikee,

I have no problem booting Solaris as a chainloader from lilo...but it goes to grub which is in the Solaris superblock and then I have to boot Solaris from there.

What I was asking about was if you knew how to get grub off the Solaris superblock so I can boot Solaris directly as a chainloader entry from lilo.

Thanks again,
Rand
 
Old 01-12-2007, 07:47 AM   #13
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Solaris (on x86) now requires GRUB to boot. You cannot directly boot it from lilo.
 
Old 01-12-2007, 08:49 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398

Original Poster
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Radux,

Sorry I didn't catch your meaning before.

I believe jlliage is spot on.

The chainloading is just a term given to a boot loader "A" booting another boot loader "B". I believe this is the indirect method. Since the new Solaris, as jlliagre pointed out, now uses Grub as the boot loader, therefore any other system wanting to boot Solaris must go through Grub.

The way you got in mind could be the direct booting off Lilo. This requires Lilo the ability to read a Solaris partition and locate its kernel to form a code for loading it into the memory. I was told Lilo can't even read Ext2/Ext3 partition and the information has to be obtained from the kernel. Unless Lilo, even with the assistance from the kernel, can locate the hard disk address of the Solaris kernel it is technically impossible for Lilo to boot Solaris directly.

Older Solaris has a different boot loader and that is a possibility to avoid Grub.

However Grub's appearnace is controlled by the timeout statement and the defaultbooting choice is dictated by the default statement. These two variables are almost exactly the same as used by Lilo except the "=" isn't required. Therefore if you adjust the timeout statement in Grub so that it passes the screen in a split second then whether it is Grub that Lilo is booting to isn't really an issue, is it?

As far as I am aware the superblocks or the boot sector can be altered by (a) overwritting it with another boot loader. Suppose a user installs Grub, in additional to Lilo, into a Slackware which resides in hda3 then either Lilo or Grub can take over the superblock by command
Code:
grub-install /dev/hda3
or
Code:
lilo -b /dev/hda3
respectively.

The other way (b) is to fill it with zero using the dd command, making the distro inside unbootable by itself.
 
Old 01-13-2007, 10:29 AM   #15
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
That's a brilliant suggestion Saikee, I didn't think of it. I should just try to make lilo the superblock bootloader. The only thing then might be that I get the full lilo menu of OS when I boot into the Solaris superblock???

I will try this and let you and Jlliagre know the results soon.

Thanks,
Rand
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Move OS to another partition giuseppe82 Linux - Software 2 09-06-2005 11:44 AM
Just installed Solaris 10 and.......... webwolf70 Solaris / OpenSolaris 3 03-08-2005 05:17 PM
MOVING INSTALLED PROGRAMS for MANDRAKE Move ihsanart Linux - Newbie 1 09-13-2004 04:50 PM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
Is it easy to move from dial up to broadband? cmisip Linux - Networking 8 04-03-2003 07:03 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration