Re: using bsdlabel

2006-05-31 Thread Jerry McAllister
> 
> 
> Jerry McAllister writes:
> 
> >  The only thing you aren't doing in either of these cases is making 
> >  that da0s1a bootable.  If you want that, you need to do:   
> 
>   That's because it already is, and I do _not_ want to change that.
>   It's a 4.5 G disk.  When I installed the system, I spent 0.5 G
> on /, 1 G for swap, another for /var ... and left the rest
> untouched.
>   I now have a project that can use that space.

OK.  No problem.

By the way, you can't run bsdlabel on a mounted and active slice.
So, if you are booted to da0s1, then it won't work.   You will need
to do something like boot to the fixit CD or boot from another disk 
(which will change your device name for that moment).

> >  If I am doing it by hand, I would prefer using direct edit as in:
> >  (NOTE, you apparently already have some usable label on the disk)
> >  
> >  >> bsdlabel -e -r da0s1
> >  
> >  This will bring up an edit session (vi unless you have your editor
> >  set to something else - I use vi)
> >  as follows.
> >  
> >  > # /dev/da0s1:
> >  > 8 partitions:
> >  > #size   offsetfstype  [fsize bsize bps/cpg]
> >  >   a:  102400004.2BSD  0 0 0
> >  >   b:  2097152*  swap
> >  >   c:*0unused  0 0   # "raw" part, don't 
> > edit
> >  >   d:  2097152*4.2BSD  0 0 0
> >  >   e:**4.2BSD  0 0 0
> 
>   So (using the file method) I can specify the start, use '*' for
> the size, and it will compute the correct value for "rest of the slice"?

Yes, you can do it both with file and edit method.  You only need to
specify the offset for the first slice and then * after that for offset.
Then size for every one except the last which can also be * - and it
will put everything left in to that last one.

It works just dandy for me that way.

jerry

> 
> 
>   Robert Huff
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: using bsdlabel

2006-05-31 Thread Robert Huff

Jerry McAllister writes:

>  The only thing you aren't doing in either of these cases is making 
>  that da0s1a bootable.  If you want that, you need to do:   

That's because it already is, and I do _not_ want to change that.
It's a 4.5 G disk.  When I installed the system, I spent 0.5 G
on /, 1 G for swap, another for /var ... and left the rest
untouched.
I now have a project that can use that space.


>  If I am doing it by hand, I would prefer using direct edit as in:
>  (NOTE, you apparently already have some usable label on the disk)
>  
>  >> bsdlabel -e -r da0s1
>  
>  This will bring up an edit session (vi unless you have your editor
>  set to something else - I use vi)
>  as follows.
>  
>  > # /dev/da0s1:
>  > 8 partitions:
>  > #size   offsetfstype  [fsize bsize bps/cpg]
>  >   a:  102400004.2BSD  0 0 0
>  >   b:  2097152*  swap
>  >   c:*0unused  0 0   # "raw" part, don't 
> edit
>  >   d:  2097152*4.2BSD  0 0 0
>  >   e:**4.2BSD  0 0 0

So (using the file method) I can specify the start, use '*' for
the size, and it will compute the correct value for "rest of the slice"?


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: using bsdlabel

2006-05-31 Thread Jerry McAllister
> 
>   I've never used bsdlabel before; would someone please confirm
> I've got this right?
>   Status quo:
> 
> huff@>> bsdlabel da0s1
> # /dev/da0s1:
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:  102400004.2BSD0 0 0 
>   b:  2097152  1024000  swap
>   c:  89160120unused0 0 # "raw" part, don't 
> edit
>   d:  2097152  31211524.2BSD0 0 0 
> 
>   As I understand it, if I run this:
> 
> huff@>> bsdlabel -w da0s1 -f /label.new
> 
>   where /label.new has:
> 
> # /dev/da0s1:
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:  102400004.2BSD0 0 0 
>   b:  2097152  1024000  swap
>   c:  89160120unused0 0 # "raw" part, don't 
> edit
>   d:  2097152  31211524.2BSD0 0 0 
>   e:  3697708  51283044.2BSD0 0 0 
> 
>   this will allocate the rest of the slice to partition 'e'.
> (And we're ready to newfs.)

If I am doing it by hand, I would prefer using direct edit as in:
  (NOTE, you apparently already have some usable label on the disk)

>> bsdlabel -e -r da0s1

This will bring up an edit session (vi unless you have your editor
set to something else - I use vi)
as follows.

> # /dev/da0s1:
> 8 partitions:
> #size   offsetfstype  [fsize bsize bps/cpg]
>   a:  102400004.2BSD  0 0 0
>   b:  2097152*  swap
>   c:*0unused  0 0   # "raw" part, don't edit
>   d:  2097152*4.2BSD  0 0 0
>   e:**4.2BSD  0 0 0
>

Then, just write and quit the edit session  

It will calculate the last partition size and all the offsets for you 
just the way you want it.

I use this method in our programs that automatically build variable
sized disks for our clients.  I fix the size of root (da0s1a), swap (da0s1b)
and tmp (da0s1e) and then make the last partition (da0s1f) contain all the 
remainder, whatever it is.  It works just fine.   

If you really want to work from a file, put the output of your bsdlabel
into the file and then edit it as I show above.

  bsdlabel -r da0s1 >> label.new
  vi label.new

Then do: 
  disklabel -R da0s1 label.new 

The only thing you aren't doing in either of these cases is making 
that da0s1a bootable.  If you want that, you need to do:   
either
  bsdlabel -B da0s1
  bsdlabel -r -e   and then do the edits as above

or to do it from a file as created above do:

   disklabel -R -B da0s1 label.new 

jerry


> 
>   Robert Huff
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: using bsdlabel

2006-05-31 Thread Giorgos Keramidas
On 2006-05-31 15:30, Robert Huff <[EMAIL PROTECTED]> wrote:
>
>   I've never used bsdlabel before; would someone please confirm
> I've got this right?
>   Status quo:
>
> huff@>> bsdlabel da0s1
> # /dev/da0s1:
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:  102400004.2BSD0 0 0
>   b:  2097152  1024000  swap
>   c:  89160120unused0 0 # "raw" part, don't 
> edit
>   d:  2097152  31211524.2BSD0 0 0
>
>   As I understand it, if I run this:
>
> huff@>> bsdlabel -w da0s1 -f /label.new
>
>   where /label.new has:
>
> # /dev/da0s1:
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:  102400004.2BSD0 0 0
>   b:  2097152  1024000  swap
>   c:  89160120unused0 0 # "raw" part, don't 
> edit
>   d:  2097152  31211524.2BSD0 0 0
>   e:  3697708  51283044.2BSD0 0 0
>
>   this will allocate the rest of the slice to partition 'e'.
> (And we're ready to newfs.)

Yes, this looks ok :)

The 'e' partition can only start *after* the 'd' partition, so it should
have an offset of:


'd' start  + 'd' size
-
3121152+ 2097152  = 5218304

The 'rest' of the disk is:

'c' size   - 'e' start
 -
8916012- 5218304   = 3697708

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"