9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Install Advice Requested.
@ 2013-06-30 15:50 Erik Quanstrom
  2013-06-30 17:34 ` tlaronde
  0 siblings, 1 reply; 8+ messages in thread
From: Erik Quanstrom @ 2013-06-30 15:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

The wording might not be what was intended.  Prep -p emits commands to build the sd(3) partition table in memory.  Nothing is written to disk. 

- erik


Terry Wendt <silicon.penguin67@gmail.com> wrote:

>tlaronde - Thank you for the abstract you sent.  It sent me to the
>manual pages, which is almost always a good thing.  In the prep(8)
>online manual page, I found the following listed as a bug:
>
>"If prep –p doesn't find a Plan 9 partition table, it will emit
>commands to delete all extant partitions. Similarly, fdisk –p will
>delete all partitions, including data, if there are no partitions
>defined in the MBR."
>
>Could this be what has been whacking my extended partitions?
>
>Anyway, I'm going to do a lot more reading before a third attempt at
>installing.  I want to make sure everything is ready before jumping in
>again.
>
>Thanks,
>Terry.
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Install Advice Requested.
  2013-06-30 15:50 [9fans] Install Advice Requested Erik Quanstrom
@ 2013-06-30 17:34 ` tlaronde
  0 siblings, 0 replies; 8+ messages in thread
From: tlaronde @ 2013-06-30 17:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Sun, Jun 30, 2013 at 11:50:34AM -0400, Erik Quanstrom wrote:
> The wording might not be what was intended.  Prep -p emits commands to build the sd(3) partition table in memory.  Nothing is written to disk.
>

Nonetheless, if things haven't changed, Plan9 can not be installed on an
extended partition; and will probably not install on a disk split with
GPT (but in this case, if there are extended partitions, this is not
GPT).

It is wise to read the manpages before doing an install, and maybe
recommended to use another fdisk to allocate a Plan9 partition (slice)
and let, afterwards, Plan9 installation scripts organize the Plan9 slice
without touching other non Plan9 partitions or the MBR.

Once more: if things haven't changed since I wrote the howto---if
the fat partition is set in the Plan9 partition, the scripts assume
that the installation is done. This could lead, if the installation
is interrupted after this step is done but before the installation
completes, to the inability to proceed with the rest of the
installation. In this case (if nothing is really set in the Plan9
partition) erasing the first two blocks of the Plan9 partition
should allow the installation to complete.

--
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                      http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Install Advice requested
  2013-06-30  1:30 [9fans] Install Advice requested Terry Wendt
  2013-06-30  5:26 ` Matthew Veety
@ 2013-07-01  9:10 ` Artem Novikov
  1 sibling, 0 replies; 8+ messages in thread
From: Artem Novikov @ 2013-07-01  9:10 UTC (permalink / raw)
  To: 9fans

воскресенье, 30 июня 2013 г., 9:30:07 UTC+8 пользователь Terry Wendt написал:
> I created a partition and started the plan9 install using plan9.iso.
> 
> It was an incomplete install, and I had some other problems from which
> 
> I've recovered. 8^)
> 
> 
> 
> I created a directory on the plan9 partition named iso, then copied
> 
> plan9.iso to that dir.
> 
> 
> 
> Can anyone provide some guidance regarding completing the install
> 
> without allowing plan9 to mark its partition as the boot partition?
> 
> 
> 
> Once the install is complete, if I need to reinstall grub2 I know how
> 
> now.  What do I tell grub2 to point to on the plan9 partition to add
> 
> it to my grub2 menu?  And can anyone recommend any boot options I may
> 
> need to set?
> 
> 
> 
> Thank you in advance,
> 
> Terry.

Look at my post:

https://groups.google.com/forum/?hl=ru#!searchin/comp.os.plan9/windows|sort:relevance/comp.os.plan9/3ynnxi3oIw8/A-C6V_zFwwkJ

maybe it will help you



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [9fans] Install Advice Requested.
@ 2013-06-30 15:35 Terry Wendt
  0 siblings, 0 replies; 8+ messages in thread
From: Terry Wendt @ 2013-06-30 15:35 UTC (permalink / raw)
  To: 9fans

tlaronde - Thank you for the abstract you sent.  It sent me to the
manual pages, which is almost always a good thing.  In the prep(8)
online manual page, I found the following listed as a bug:

"If prep –p doesn't find a Plan 9 partition table, it will emit
commands to delete all extant partitions. Similarly, fdisk –p will
delete all partitions, including data, if there are no partitions
defined in the MBR."

Could this be what has been whacking my extended partitions?

Anyway, I'm going to do a lot more reading before a third attempt at
installing.  I want to make sure everything is ready before jumping in
again.

Thanks,
Terry.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Install Advice requested
  2013-06-30  6:31   ` Terry Wendt
@ 2013-06-30  8:06     ` tlaronde
  0 siblings, 0 replies; 8+ messages in thread
From: tlaronde @ 2013-06-30  8:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 911 bytes --]

On Sun, Jun 30, 2013 at 02:31:44AM -0400, Terry Wendt wrote:
>
> I copied the plan9.iso over to the plan9 partition, and even copied
> all the files and directories as well.

The plan9 partition is not an uniq filesystem but a slice of the disk
allocated to plan9 and organized in several sub-partitions, with the
first one being a fat partition.

It is unlikely, a priori, that simply "copying" a plan iso to "the"
plan9 partition will give the plan9 install any data it can access.

I attach to the message a "howto" I wrote when I had to install Plan9 on
a host with no CD drive. It is not to be used mandatorily if your CD/DVD
works, but it will give you clues about the organization of the plan9
slice.

HTH,
--
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                      http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

[-- Attachment #2: boot.txt --]
[-- Type: text/plain, Size: 12299 bytes --]

       Installing Plan9 without a CD reader or a PXE boot.

                            Abstract

The Plan9 distribution is available for installation by the mean of a
bootable ISO image supposed to be burnt on a CDROM. But this image has
indeed all the pieces needed to realize an installation, without a CD
reader, or without a PXE boot.

What follows is an illustration of "how to do without".

0. What was first? The egg or the goose? Well: the egg, that is some
BIOS.

In the following, the names will match the pc world; but, more or less,
there is a mapping between pc idiosynchrasies and something else
idiosynchrasies.

When a pc starts, it first initializes its hardware before giving the
hand to an user provided program---generally an operating system. But to
be able to hand over to something else, it has to know the rendez-vous
point. This BIOS entry point is a 512 bytes sector, that is a program,
and that is (for disks and like) the very first sector of the device.

On disks, it is called: MBR. It is a program with a signature (for basic
verification that it is indeed the expected program), and some data
embedded: a partition table.

To be able to boot Plan9, the information has to be in the MBR, this
means that the first sector must be able to hand over to another program
(generally one sector size too) customized for Plan9.

Since the partition table has 4 entries, for things to work, the
MBR program must be able to read the partition table and load the
very first sector of one partition, whether because it is flagged:
ACTIVE, or because the MBR allows to select it. The only Plan9
peculiar thing in the MBR is not the program by itself (the MBR
provided by other systems will generally do the job), but a Plan9
entry in the partition table.

Plan9 has to have a _primary_ partition (and not a secondary "extended"
---indirect---one that the bootstrapping blocks will not be able to
access).

Recommended reading: 9load(8).

1. Defining a Plan9 partition (MBR partition table).

As the name: partition, shall suggest, the 1 to 4 (max) primary
partitions shall realize a partition of the disk: the reunion covers the
whole disk; and there is no overlapping. One supplementary property: a
partition is declared by its type (magic number proper to the system),
its beginning and its size. This means that a partition defines a
continuous slice of sectors.

Since this partition table is what, due to hardware bootstrapping
design, is shared between different systems (multi-boot), the partition
shall declare what is each system realm in terms of space used on the
disk; and let others realms alone. (In what follows, since we will use
an already installed system to prepare for Plan9, this will be
relaxed---but as an exception and with caution.)

So the first step is to declare enough space for a Plan9 realm (for what
follows, since we do not reduce the size of the installed data and
declare 100Mb for the particular 9fat, say: 512Mb at least---this can be
reduced once you know how it works, or if you install only a terminal).
So declare a primary partition as a Plan9 : 0x39 type, with (here) at
least 512Mb. You can do that with whatever fdisk(8) is available on the
"other" system.

But do repeat: the Plan9 partition is a partition, that is do not have
any intersection (of data) with others. Plan9 can write whatever it
wants in its realm without risking overwriting others data.

Recommended reading: prep(8).

2. The Plan9 partition realm: its organization.

Fdisk(8) has declared a Plan9 realm. But this realm is, as far as
fdisk(8) and the MBR are concerned, just a continuous area of disks
blocks. There is no organization of the blocks; no data in the blocks.
It is a virgin (read: random) area.

So even if the Plan9 partition is declared active (or if the boot
process allows to select it), this will not magically work, since the
very first sector of the Plan9 partition is, at this moment, random
bytes, not a dedicated sector able to bootstrap Plan9.

We need so to organize a part of the realm the way Plan9 and the Plan9
bootstrapping process expects it to be.

The conditions that have to be met are the following:

1) The very beginning of the Plan9 partition coincides with the
beginning of a FAT12 or FAT16 subpartition.

2) This FAT has 2 reserved sectors: the first one is the "classical" FAT
sector; the second one will hold the informations about the Plan9
partition subpartionning.

3) The very first sector (of the Plan9 partition and so of the FAT too)
has a Plan9 PBS---a Plan9 bootstrapping block.

4) The volid field of the FAT first block is set with the address of
the beginning of the root dir.

5) The program 9load exists in the FAT and is the very first entry
in the root dir.

6) [Not necessary for bootstrapping] So that 5) remains true, the 9load
file must be tagged SYSTEM, so that it is not moved when updating.

7) That other files: a Plan9 kernel with an embedded root file system,
the Plan9.ini and the vgadb be there.

8) That the existence of the FAT subpartition be declared so Plan9
knows that it is already there.

This could seem complicated at first, but indeed the majority of "other"
systems have the utils to set this.

Recommended reading: 9load(8), disk/format.c.

3. Illustration of what has to be done with a NetBSD system.

We will show below an implementation of the steps using NetBSD utils
(all default provided ones).

Do note that under Unices, for the most part, you will need to be root
(or to use dedicated tricks to work as an unprivileged user).

First we create (assuming there is room in some disk) a Plan9 partition.
Basic usage of fdisk(8).

To avoid using brutally dd(1) on the whole disk, we will make the first
part of this partition, that will be a FAT16 file system, visible for
NetBSD. (This is the temporary exception signalled above.)

To do this, we simply add an entry in the disklabel of the very disk
where Plan9 is declared and will be installed. The disklabel is like
Plan9 partitionning: NetBSD sees only what is declared in its disklabel
and it is partly orthogonal to what is declared in the MBR (this is
both handy and dangerous if one plays too much with the possibilities).

Here, we have declared a Plan9 partition on wd0, with the following
characteristics:

0: Plan 9, or Theos spanned (sysid 57)
    bootmenu: Plan9
    start 63, size 2232972 (1090 MB, Cyls 0-138)

Plan9 is the very first primary partition, starting at sector 63, with
a size of 1090MB. (The values are not mandatory; it could another
offset, and another size.)

We will create a FAT16 of 100MB (to put the iso image in it; there are
more than one way to do combining the commands described below). This
FAT16 has to coincide with the very beginning of the Plan9 partition; so
_here_ sector 63.

We declare this in the disklabel, adding an entry (here the 'n') using
disklabel(8) on wd0:

 n:    204800        63      MSDOS                     # (Cyl.      0*-    203*)

So it starts at 63, is MSDOS and is 204800 blocks (so far less than
the whole plan9 partition, but _inside_ the Plan9 partition: check and
recheck; we will format and write so it has to be a scratch zone!).

>From now on, we will be able to use this dedicated area, and to
constrain for some safety, the actions to this area, we will be using
/dev/wd0n or /dev/rwd0n.

disk=wd0
part=n
dev=/dev/r${disk}$part

Before formatting (disklabel declares subpartitions but does no
formatting), we will need to retrieve Plan9 PBS and 9load.

Where to find them? In the ISO image.

The ISO image is an ISO file system in the form of an uniq file. To read
it, one has simply to find the way on the system to treat a file as
a disk. Under Plan9 this is partfs(8). Under NetBSD, this is
vnconfig(8).

So assuming the ISO is in $plan9iso (uncompressed), and a mount point
/cdrom exists:

vnconfig -c vnd0 $plan9iso
mount -t cd9660 /dev/vnd0d /cdrom

Now you have access to all the iso files under (here) /cdrom.

One file will be of special interest: bootdisk.img. What is it?

The CD is "bootable" using El Torito BIOS extensions. When the BIOS
supports this, it can present a "file" (here: bootdisk.img) as a floppy
(of whatever size, from 5"1/4 to the diverse 3"1/2; commonly, 1.44MB or
2.88MB---the latter here) or even as a hd (I have not seen this
implemented yet; this is in the spec, but in the real?).

When the PC boots, the BIOS tricks to offer this data as a fd# or hd#.
This explains why, sometimes, the CD boots---user cries: Hurrah! my
hardware is recognized!---but when the system, on the CD, takes the
hand, it panics, unable to read the CD! That's because the initial
programs use the BIOS, and use a fd# that is a fake one, accessing it
via the BIOS, while when the system takes the hand and doesn't use
anymore the BIOS services (DOS was using BIOS...), if it has not the
drivers, it doesn't know how to access.

So this image, that is a FAT filesystem, we will explore it too. Same
process (assuming a mount point named /floppy, for illustration):

vnconfig -c vnd1 /cdrom/bootdisk.img
mount -t msdos /dev/vnd01 /floppy

This image is a FAT, has what we need. So why not simply dd(1) it to the
beginning of the Plan9 partition and been done with it? For 3 reasons:

1) This is a 2.88Mb file system. A bit short if we want to put extra
stuff.

2) There is a field that has to be set with the correct address: the
volid. This value is not the correct one, unless we dd(8) on the MBR,
which I do not recommend...

3) The PBS has to bootstrap a diskette, so is not an LBA aware one. On a
disk, the Plan9 partition can be a far, far, far, far realm...

So now we have all what is needed to format the FAT16. First, we will
occupy ourselves with the PBS, taking the lba flavour. One caveat,
though: it has not the signature and it has to be there (for NetBSD
newfs_msdos(8); other programs may handle this by themselves). So we
add it:

cat /cdrom/386/pbslba /dev/zero | dd of=/tmp/pbs count=1 bs=510 conv=notrunc
printf "\x55\xAA" >>/tmp/pbs

Next, we need to compute some numbers: the fatsize, and the volid. The
details can be found in disk/format.c. The offset is the offset of the
first sector of the FAT (== first sector of the plan9 partition); the
partsizebk, is the size in 512 blocks; these 2 informations were given
above in the disklabel:

 n:    204800        63      MSDOS                     # (Cyl.      0*-    203*)

So _here_ (has to be adapted):

disk=wd0
part=n
offset=63
partsizebk=204800

Then:

fatsize=$(( (16 * ($partsizebk / 4) + 8 * 512 - 1 ) / ( 8 * 512 ) ))
volid=$(( $offset + 2 * $fatsize + 2 ))

We have all the informations to format the Plan9 FAT subpartition
(9fat):

newfs_msdos -B /tmp/pbs\
	-F 16 -S 512 -b 2048 -a $fatsize -r 2 -I $volid /dev/r${disk}$part


We add the information about the 9fat in Plan9 partition sector (the 2nd
reserved one):

printf "part %s %d %d\n" 9fat 0 $partsizebk\
	| dd of=/dev/${disk}$part seek=1 conv=notrunc

We have now a FAT ready that we can mount:

mount -t msdos /dev/${disk}$part /mnt

We copy 9load first (see 5):

cp /floppy/9load /mnt

Then the rest:

cd /floppy
cp 9pc* plan9.ini vgadb /mnt

We add the bzip2 iso image (we could put it elsewhere, or even retrieve
it by network etc.):

cat $plan9iso | bzip2 >/mnt/plan9.iso.bz2

Unmount everything:

umount /mnt
umount /floppy
vnconfig -u vnd1
umount /cdrom
vnconfig -u vnd0

And finally, for cleanliness, set the SYS flag (plus archive) on 9load
in 9fat:

printf "\x24"\
	| dd of=/dev/${disk}$part conv=notrunc\
		seek=$(((2 * $fatsize + 2) * 512 + 32 + 11)) bs=1 count=1

Now, you have a bootable Plan9. And you will discover that the
all-in-one 9pcflop.gz (a Plan9 kernel and a small root fs) has already
a lot, a lot, a lot of possibilities in a very small size. So keeping
it will make a repair tool very handy.

[Note: the installation scripts have to be adapted, since they assume
that if 9fat is here, everything is already set. This is wrong after the
above procedure.]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Install Advice requested
  2013-06-30  5:26 ` Matthew Veety
@ 2013-06-30  6:31   ` Terry Wendt
  2013-06-30  8:06     ` tlaronde
  0 siblings, 1 reply; 8+ messages in thread
From: Terry Wendt @ 2013-06-30  6:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I'm a glutton for pain.  First, it wasn't the plan9.iso, but the
9athom.iso.  I think the original problem occured by
exiting(Ctrl+Alt+Del) before the install was done.  I guess I should
have used Ctrl-d to stop the process I was in.  Anyway, after exiting
the install program and rebooting I discovered that 3 of my partitions
got whacked.  I used a live knoppix disc to boot up, get online and
get a tool to repair the borked partitions(testdisk).  Well, that
worked well.  Next, used my openSuS rescue dvd to reinstall grub2, and
got everything back up.

I copied the plan9.iso over to the plan9 partition, and even copied
all the files and directories as well.  Remember though, I actually
was installing from the 9atom.iso... genius.  I finally figured out
how to setup grub2 for plan 9.  Then I kept getting the same error
over and over trying to boot into that partition: "error: invalid
signature".  Went into fdisk and toggled the partition TYPE flag to
0x39, done.  At this point, I could boot from grub2 into plan9, but of
course the install wasn't complete.

This is where the pain begins again.

Insert 9atom.iso.  Reboot.  The install picked up where it left off.
Got all the to [copydist].  It was in the middle of this that it ran
out of room!  Oh yeah, that copy of plan9.iso sitting there and it was
only a 1.1GB partition. Control-D my way out, go back into openSuSE
and try to go into the plan9 partition to delete the iso file - nope,
that wasn't gonna happen, there were only 3 or 4 files there??? I
guess the rest of the filesystem couldn't be seen... ok, no problem.
Delete the partition, double the size to 2.2GB.  Reboot using the
9atom.iso, and start the install.  Now, for some reason, 9atom doesn't
like the partition?  Do I control-d my way out I ask?  Of course not -
control-alt-delete.  Reboot.  Grub can't find a bootable partition...
Yep, whacked my system again.  The real strange thing is its all the
linux partitions on the extend partition?  Very strange.

So here I am again in knoppix, doing it all over again.  But I must
admit, I learn a lot via these sessions of self-abuse.  8^0

It would be nice if it wouldn't do that by exiting the install in a
way it doesn't like.  Maybe it could intercept that trio of
keys(control-alt-del) and produce the control-d itself??

Ok, wish me luck, I'm going in.
Terry.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] Install Advice requested
  2013-06-30  1:30 [9fans] Install Advice requested Terry Wendt
@ 2013-06-30  5:26 ` Matthew Veety
  2013-06-30  6:31   ` Terry Wendt
  2013-07-01  9:10 ` Artem Novikov
  1 sibling, 1 reply; 8+ messages in thread
From: Matthew Veety @ 2013-06-30  5:26 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Jun 29, 2013, at 21:30, Terry Wendt <silicon.penguin67@gmail.com> wrote:

> I created a partition and started the plan9 install using plan9.iso.
> It was an incomplete install, and I had some other problems from which
> I've recovered. 8^)
> 
> I created a directory on the plan9 partition named iso, then copied
> plan9.iso to that dir.
> 
> Can anyone provide some guidance regarding completing the install
> without allowing plan9 to mark its partition as the boot partition?
> 
> Once the install is complete, if I need to reinstall grub2 I know how
> now.  What do I tell grub2 to point to on the plan9 partition to add
> it to my grub2 menu?  And can anyone recommend any boot options I may
> need to set?
> 
> Thank you in advance,
> Terry.
> 

You can tell it not to install the mbr. Also you can chain load it similar to windows with grub2.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [9fans] Install Advice requested
@ 2013-06-30  1:30 Terry Wendt
  2013-06-30  5:26 ` Matthew Veety
  2013-07-01  9:10 ` Artem Novikov
  0 siblings, 2 replies; 8+ messages in thread
From: Terry Wendt @ 2013-06-30  1:30 UTC (permalink / raw)
  To: 9fans

I created a partition and started the plan9 install using plan9.iso.
It was an incomplete install, and I had some other problems from which
I've recovered. 8^)

I created a directory on the plan9 partition named iso, then copied
plan9.iso to that dir.

Can anyone provide some guidance regarding completing the install
without allowing plan9 to mark its partition as the boot partition?

Once the install is complete, if I need to reinstall grub2 I know how
now.  What do I tell grub2 to point to on the plan9 partition to add
it to my grub2 menu?  And can anyone recommend any boot options I may
need to set?

Thank you in advance,
Terry.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-01  9:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-30 15:50 [9fans] Install Advice Requested Erik Quanstrom
2013-06-30 17:34 ` tlaronde
  -- strict thread matches above, loose matches on Subject: below --
2013-06-30 15:35 Terry Wendt
2013-06-30  1:30 [9fans] Install Advice requested Terry Wendt
2013-06-30  5:26 ` Matthew Veety
2013-06-30  6:31   ` Terry Wendt
2013-06-30  8:06     ` tlaronde
2013-07-01  9:10 ` Artem Novikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).