[comp.os.minix] /dev/hd5

roeder@sbsvax.UUCP (Edgar Roeder) (02/21/89)

Last weekend i tried to address my SH205 as one Filesystem via /dev/hd5 under
Minix. I ran across one serious problem. At boot time the physical sector 0 of
the harddisk is used to determine the size of the harddisk and the available
partitions. When you address it as a single filesystem via minor number 5 the
same sector 0 is now used to hold data. The next time you try to mount this
drive after a reboot the system refuses this because the partioning info is not
valid anymore.
My proposed solution is to use minor 5 to address the whole disk without sector
0. You have still access to this sector via minor 0. A patch to stwini.c
follows.

	- Edgar

----------------------------- start of patch -----------------------------------

*** stwini.c.old	Mon Feb 20 18:43:31 1989
--- stwini.c	Mon Feb 20 18:43:17 1989
***************
*** 105,111 ****
  		if (pi[minor].pi_flag == PI_INVALID)
  			pi[minor].pi_size = 0;
  	}
! 	pi[minor].pi_size = hi.hd_size;
    }
    TRACE(
  	for (r = 0; r < MAX_MINOR; r++)
--- 105,113 ----
  		if (pi[minor].pi_flag == PI_INVALID)
  			pi[minor].pi_size = 0;
  	}
! 	/* physical sector 0 is needed for partition info */
! 	pi[minor].pi_start = 1;
! 	pi[minor].pi_size = hi.hd_size - SECTOR_SIZE;
    }
    TRACE(
  	for (r = 0; r < MAX_MINOR; r++)

------------------------------ end of patch ------------------------------------

hcj@lzaz.ATT.COM (HC Johnson) (02/23/89)

In article <689@sbsvax.UUCP>, roeder@sbsvax.UUCP (Edgar Roeder) writes:
> Last weekend i tried to address my SH205 as one Filesystem via /dev/hd5 under
> Minix.  When you address it as a single filesystem via minor number 5 the
> same sector 0 is now used to hold data. 
> My proposed solution is to use minor 5 to address the whole disk without sector
There are many ways to change stwini.c but please, not this way.
/dev/hd5 is the WHOLE disk, and is, in the UNIX(r) spirit, there to allow
backup of the whole thing.  If you want to add a new partitioning scheme
use hd6 and hd7 which are not implemented.  I prefer hd6, as it never
will be implemented on the ATARI, as it does bad blocks differently.

Howard C. Johnson
ATT Bell Labs
att!lzaz!hcj
hcj@lzaz.att.com

johan@nlgvax.UUCP (Johan Stevenson) (02/24/89)

In article <689@sbsvax.UUCP> roeder@sbsvax.UUCP (Edgar Roeder) writes:
>My proposed solution is to use minor 5 to address the whole disk without sector
>0. You have still access to this sector via minor 0.

I do not agree. Minor 5 is supposed to access the whole disk.
You can already do what you want to do by allocating the whole disk
minus sector 0 as the first and only partition.
--
Johan W. Stevenson	johan@pcg.philips.nl		Philips Research