Re: can't make an 'a' slice except with auto-defaults

2010-02-09 Thread Garance A Drosihn

At 7:59 PM -0700 2/2/10, Steve Franks wrote:

On a running system.  I mean, I know I should quit being a %^# and
read the manpage for bsdlabel, but sysintall really does have a nice
tui.'C'reate slice goes straight to 'd', even on a 'fresh' disk.
I see in the handbook, this is alluded to, but some intermediate level
between begginer and expert (bsdlabel just strikes me as way too easy
to trash the disk I'm running off of while trying to make a backup),
would be nice...512M just won't fit the kernel+symbols.



If you're running into the issue that I think you're running into,
then there is a way to trick sysinstall to do what you want.

When you ask sysinstall to create that first partition, claim that
you are creating the partition named '/'.  If you do that, it will
put the partition in as a.  You couldn't actually partition it as
'/', of course, because that would conflict with '/' on your
running system.  But sysinstall will let you say you want to create
'/', and then use a for that partition.

Then select that a partition, and tell sysinstall you want to
change the name for that partition.  Change it to whatever you
want.  At that point sysinstall can't change the partition from a
to d, so you'll have the mount-point that you really want as the
a partition.

--
Garance Alistair Drosehn=   g...@gilead.netel.rpi.edu
Senior Systems Programmer   or  g...@freebsd.org
Rensselaer Polytechnic Instituteor  dro...@rpi.edu
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-09 Thread Steve Franks
 If you're running into the issue that I think you're running into,
 then there is a way to trick sysinstall to do what you want.

 When you ask sysinstall to create that first partition, claim that
 you are creating the partition named '/'.  If you do that, it will
 put the partition in as a.  You couldn't actually partition it as
 '/', of course, because that would conflict with '/' on your
 running system.  But sysinstall will let you say you want to create
 '/', and then use a for that partition.

 Then select that a partition, and tell sysinstall you want to
 change the name for that partition.  Change it to whatever you
 want.  At that point sysinstall can't change the partition from a
 to d, so you'll have the mount-point that you really want as the
 a partition.

I really should have thought of that!  So you create it as /, and
then hit 'M' and change the mount point to, say, /mnt/root...

Thanks,
Steve
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Pieter de Goeje
On Wednesday 03 February 2010 03:59:15 Steve Franks wrote:
 On a running system.  I mean, I know I should quit being a %^# and
 read the manpage for bsdlabel, but sysintall really does have a nice
 tui. 

sade(8) is the standalone version of sysinstall's partitioning subroutine. 
Also, if you're running a reasonably recent version of FreeBSD, you might want 
to take a look at gpart(8) which can do slicing and labeling (and a whole 
bunch of other disk partitioning related stuff).

Regards,

Pieter

 'C'reate slice goes straight to 'd', even on a 'fresh' disk.
 I see in the handbook, this is alluded to, but some intermediate level
 between begginer and expert (bsdlabel just strikes me as way too easy
 to trash the disk I'm running off of while trying to make a backup),
 would be nice...512M just won't fit the kernel+symbols.
 
 fuming, reading man bsdlabel ;) 
 
 Steve
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Polytropon
Just a sidenote to avoid misunderstandings:

On Tue, 2 Feb 2010 19:59:15 -0700, Steve Franks bahamasfra...@gmail.com wrote:
 'C'reate slice goes straight to 'd', even on a 'fresh' disk.

I think you create a partition, not a slice. The slice
editor would 'C'reate 's1'. :-)



 I see in the handbook, this is alluded to, but some intermediate level
 between begginer and expert (bsdlabel just strikes me as way too easy
 to trash the disk I'm running off of while trying to make a backup),
 would be nice...512M just won't fit the kernel+symbols.

According to the handbook,

http://www.freebsd.org/doc/handbook/install-steps.html

you should make sure that you've selected a CUSTOM install,
visit the slice editor (if needed) and the partition editor
afterwards. Creating partitions should start with 'a', and
if you want to use the whole disk, 'a' is the default
(because 'a' usually refers to the booting partition).

A case when no 'a' partition can be created does exist when
there is already an 'a' partition on the slice. If that's
the case, make sure it's not the case. :-)



 fuming, reading man bsdlabel ;) 

FUMEN PROHIB, LEGERE LEVITICUS! :-)


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Jerry McAllister
On Tue, Feb 02, 2010 at 07:59:15PM -0700, Steve Franks wrote:

 On a running system.  I mean, I know I should quit being a %^# and
 read the manpage for bsdlabel, but sysintall really does have a nice
 tui.'C'reate slice goes straight to 'd', even on a 'fresh' disk.
 I see in the handbook, this is alluded to, but some intermediate level
 between begginer and expert (bsdlabel just strikes me as way too easy
 to trash the disk I'm running off of while trying to make a backup),
 would be nice...512M just won't fit the kernel+symbols.
 
 fuming, reading man bsdlabel ;) 

Well, Create slice would be an fdisk(8) thing, not bsdlabel.
bsdlabel creates partitions within a slice.

But, generally you cannot run fdisk on a disk that is in use on a 
running system - which generally means that it is the boot device, 
has filesystems mounted or has part of the currently designated swap 
space.  You will need to plug in a boot cd or bring up the fixit system
for that.   The fixit system runs from memory - creates filesystems
and mount points in memory rather than on disk, so it can talk to
any disk.

New, if you are working on a non-used (extra) disk, eg one that is not
the boot device nor has any mounted filesystems or swap space
on it, then you should be able to fdisk and bsdlabel that from
a running system.

I have no idea what you mean by 'C'reate slice goes straight to 'd'
It does not match anything I remember being possible.  I don't happen
to have any system handy at the moment that I can muck with disks on.

jerry


 
 Steve
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Steve Franks
On Wed, Feb 3, 2010 at 8:18 AM, Jerry McAllister jerr...@msu.edu wrote:
 On Tue, Feb 02, 2010 at 07:59:15PM -0700, Steve Franks wrote:

 On a running system.  I mean, I know I should quit being a %^# and
 read the manpage for bsdlabel, but sysintall really does have a nice
 tui.    'C'reate slice goes straight to 'd', even on a 'fresh' disk.
 I see in the handbook, this is alluded to, but some intermediate level
 between begginer and expert (bsdlabel just strikes me as way too easy
 to trash the disk I'm running off of while trying to make a backup),
 would be nice...512M just won't fit the kernel+symbols.

 fuming, reading man bsdlabel ;) 

 Well, Create slice would be an fdisk(8) thing, not bsdlabel.
 bsdlabel creates partitions within a slice.

 But, generally you cannot run fdisk on a disk that is in use on a
 running system - which generally means that it is the boot device,
 has filesystems mounted or has part of the currently designated swap
 space.  You will need to plug in a boot cd or bring up the fixit system
 for that.   The fixit system runs from memory - creates filesystems
 and mount points in memory rather than on disk, so it can talk to
 any disk.

 New, if you are working on a non-used (extra) disk, eg one that is not
 the boot device nor has any mounted filesystems or swap space
 on it, then you should be able to fdisk and bsdlabel that from
 a running system.

 I have no idea what you mean by 'C'reate slice goes straight to 'd'
 It does not match anything I remember being possible.  I don't happen
 to have any system handy at the moment that I can muck with disks on.

 jerry

Ok, terminology crash.  As someone pointed out, I'm talking about
label, here, not fdisk, and partitions, not slices (had those two
backwards in my head).

Basically, as far as I can tell, on a running system, there is no
combination of keystrokes in sysinstall's label editor that will
create an ad[1-9]s1a, except the 'a' key which produces a 512M s1a.
All other keystrokes (namely 'c') go straight to ad[1-9]s1d when a
second disk is placed in a system booted from ad0s1a.  I'm just trying
to make a fresh disk ready for dump/restore with a 1G /, so I guess
sysinstall is out as an option at this time.

Steve
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Polytropon
On Wed, 3 Feb 2010 10:26:06 -0700, Steve Franks bahamasfra...@gmail.com wrote:
 I'm just trying
 to make a fresh disk ready for dump/restore with a 1G /, so I guess
 sysinstall is out as an option at this time.

Why so complicated? The command

# newfs /dev/ad1

will prepare the disk, assuming ad1 is the new disk. It
will create one single partition covering the whole disk,
with no slice. You can then run

# mount /dev/ad1 /mnt

to access it; /dev/ad1 is the same as /dev/ad1c, the
whole disk.

By the way, have you tried the program

# sade

instead of sysinstall?


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Steve Franks
 Why so complicated? The command

        # newfs /dev/ad1

I'm looking to mirror/dup/image the entire system to something I can
stick in another system.I hear there's good reasons for not
running my whole system off of a single partition.  The 'other' system
has 7.2 and has devolved to a 25% chance of a hard freeze every time I
unplug a ucom device (seems to have cropped up between 7.2-release and
7.2-stable#3).  8 likes usb, so I like 8.

Steve
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Polytropon
On Wed, 3 Feb 2010 10:42:42 -0700, Steve Franks bahamasfra...@gmail.com wrote:
  Why so complicated? The command
 
         # newfs /dev/ad1
 
 I'm looking to mirror/dup/image the entire system to something I can
 stick in another system.  

Sorry, my misunderstanding. I thought you're intending to
use the second disk as a pure data disk.



  I hear there's good reasons for not
 running my whole system off of a single partition. 

The example above would not only create one single partition,
it would furthermore omit the slice containing it. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Jerry McAllister
On Wed, Feb 03, 2010 at 06:37:22PM +0100, Polytropon wrote:

 On Wed, 3 Feb 2010 10:26:06 -0700, Steve Franks bahamasfra...@gmail.com 
 wrote:
  I'm just trying
  to make a fresh disk ready for dump/restore with a 1G /, so I guess
  sysinstall is out as an option at this time.
 
 Why so complicated? The command
 
   # newfs /dev/ad1
 
 will prepare the disk, assuming ad1 is the new disk. It
 will create one single partition covering the whole disk,
 with no slice. You can then run
 
   # mount /dev/ad1 /mnt
 
 to access it; /dev/ad1 is the same as /dev/ad1c, the
 whole disk.

This gets you what is referred to as a dangerously dedicated disk
in the documentation.If you are doing nothing unusual with other
OSen, then it works fine.But, it is also not at all hard to use
fdisk and bsdlabel to create the full slice+partition.

Here is the basic routine.

   dd if=/dev/zero of=/dev/ad1 bs=512 count=1024
   fdisk -BI ad1
   dd if=/dev/zero of=/dev/ad1s1 bs=512 count=1024
   bsdlabel -w -B ad1s1
   bsdlabel -e ad1s1

The second bsdlabel command puts you in to an edit session.
Edit the partition table to something like this, then save[write] and exit.
(Just those two lines for a single partition disk)

# /dev/ad1s1:
8 partitions:
#size  offset   fstype   [fsize bsize bps/cpg]
  c: 89867610   0   unused0 0 # raw part, don't edit
  h:*   0   4.2BSD 2048 16384 8 

You can use any partition identifier except 'c', but I like to 
reserve 'a' for bootable root (/) and 'b' for swap to reduce 
the confusion in my head.   

If the disk will not be bootable take out the 'B' from each of 
the fdisk and bsdlabel commands.

You probably do not need the two dd-s, but sometimes they are 
needed if the system cannot read the sector 0  on the disk for
some reason.

Finally, when that is done, do:

   newfs /dev/ad1s1d

Make yourself a mount point and mount the new disk.

   mkdir /bigwork
   mount /dev/ad1s1d /bigwork

Edit /etc/fstab so it will mount automatically.

It is not weird or mysterious, though I admit the man pages
for both fdisk and bsdlabel could stand a going through.
They do not follow the conventions of most man pages in the
way they describe the switches and parameters.   Fortunately
they have lots of examples (but could use even more).

jerry  


 
 By the way, have you tried the program
 
   # sade
 
 instead of sysinstall?
 
 
 -- 
 Polytropon
 Magdeburg, Germany
 Happy FreeBSD user since 4.0
 Andra moi ennepe, Mousa, ...
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Jerry McAllister
On Wed, Feb 03, 2010 at 10:42:42AM -0700, Steve Franks wrote:

  Why so complicated? The command
 
         # newfs /dev/ad1
 
 I'm looking to mirror/dup/image the entire system to something I can
 stick in another system.I hear there's good reasons for not
 running my whole system off of a single partition.  

The three main reasons are:

Backups.It is often easier to manage backups when the disk storage
is thoughtfully divided into reasonable and functional pieces.

Emergencies.  If your system crashes, especially if it is due to
some disk problem, you may need to boot your system to single user.
In that case you will start with only / (root) mounted as read-only.
Having a fairly small root partition means the chance of having the
bad disk area be in what you are trying to mount is reduced (not
eliminated, of course).  Anyway, you may be more able to get up to
a minimal system and then work on recovering the other partitions.

Boot time. A possible benefit is that only root needs to be fsck-ed before
other things can start.   Remaining fsck-s can run in parallel.  This
will take you less time to get back up after an abnormal shutdown - 
such as from a sudden power loss.

 The 'other' system
 has 7.2 and has devolved to a 25% chance of a hard freeze every time I
 unplug a ucom device (seems to have cropped up between 7.2-release and
 7.2-stable#3).  8 likes usb, so I like 8.

FreeBSd 8 is a good choice.

jerry

 
 Steve
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't make an 'a' slice except with auto-defaults

2010-02-03 Thread Ian Smith
In freebsd-questions Digest, Vol 296, Issue 6, Message: 20
On Wed, 3 Feb 2010 10:26:06 -0700 Steve Franks bahamasfra...@gmail.com wrote:
  On Wed, Feb 3, 2010 at 8:18 AM, Jerry McAllister jerr...@msu.edu wrote:
   On Tue, Feb 02, 2010 at 07:59:15PM -0700, Steve Franks wrote:
  
   On a running system.  I mean, I know I should quit being a %^# and
   read the manpage for bsdlabel, but sysintall really does have a nice
   tui.    'C'reate slice goes straight to 'd', even on a 'fresh' disk.

sysinstall (or sade) will assign 'd' to the first partition if its mount 
point for the partition is not specified as '/'.  This is usually right, 
when partitioning either another slice on the same disk, or a slice on 
another disk, where '/' is already assigned to the booted disk.

In the case of what you're doing, ie preparing another disk to copy your 
system to, it's not hard to fix that later with bsdlabel -e, as Jerry 
has pointed out, and which I'll detail further below.

   I see in the handbook, this is alluded to, but some intermediate level
   between begginer and expert (bsdlabel just strikes me as way too easy
   to trash the disk I'm running off of while trying to make a backup),
   would be nice...512M just won't fit the kernel+symbols.

A default 1GB '/' is on the cards, perhaps by 8.1, but in any case I've 
never used anything like the autodefaults for other partitions either.

bsdlabel(8) is not so scary.  For one thing, anything you do is shown 
but not committed to disk if you use the -n switch.  Try it.  Also, the 
man has examples of saving and restoring an existing label, so if you:

# bsdlabel ad1s1  saved.ad1s1.label
then if you stuff it up you can later on just restore it with:
# bsdlabel -R ad1s1 saved.ad1s1.label

   fuming, reading man bsdlabel ;) 
  
   Well, Create slice would be an fdisk(8) thing, not bsdlabel.
   bsdlabel creates partitions within a slice.
  
   But, generally you cannot run fdisk on a disk that is in use on a
   running system - which generally means that it is the boot device,
   has filesystems mounted or has part of the currently designated swap
   space.  You will need to plug in a boot cd or bring up the fixit system
   for that.   The fixit system runs from memory - creates filesystems
   and mount points in memory rather than on disk, so it can talk to
   any disk.

If you set kern.geom.debugflags=16 and 'w'rite from either sysinstall's 
fdisk or bsdlabel screens you can update the partition table or your new 
slice's bsdlabel, but you have to be very careful, and in the case of 
fdisk, you need to reboot before labeling the new slice.  Certainly 
using a fixit boot is the safe and sure way to avoid complications.

   New, if you are working on a non-used (extra) disk, eg one that is not
   the boot device nor has any mounted filesystems or swap space
   on it, then you should be able to fdisk and bsdlabel that from
   a running system.

This seems to be Steve's case, but he's right; it will start creating 
new partitions as 'd' rather than 'a' (since there's already a '/') 
unless he boots into either sysinstall or fixit from another source.

   I have no idea what you mean by 'C'reate slice goes straight to 'd'
   It does not match anything I remember being possible.  I don't happen
   to have any system handy at the moment that I can muck with disks on.
  
   jerry

I've several times added partitions to extra slice/s on either the boot 
disk or added disks (including sliced USB flash disks) using sysinstall 
invoked from the running system, and these do start with 'd' partition.

  Ok, terminology crash.  As someone pointed out, I'm talking about
  label, here, not fdisk, and partitions, not slices (had those two
  backwards in my head).
  
  Basically, as far as I can tell, on a running system, there is no
  combination of keystrokes in sysinstall's label editor that will
  create an ad[1-9]s1a, except the 'a' key which produces a 512M s1a.

The 'a' key auto-assigns '/' as the mount point for partition 'a', which 
is why you see that.  You wouldn't be able to commit that anyway, as /, 
/var, /usr would conflict with your already mounted slice, and newfs'ing 
your existing system is most likely not what you want :)

  All other keystrokes (namely 'c') go straight to ad[1-9]s1d when a
  second disk is placed in a system booted from ad0s1a.  I'm just trying
  to make a fresh disk ready for dump/restore with a 1G /, so I guess
  sysinstall is out as an option at this time.

You may be better off just installing the new system onto ad1 straight 
up, ignoring your ad0, when you can just use sysinstall.  However ..

sysinstall (or sade) run from an existing system is a pretty convenient 
way to partition a disk, or slice.  You don't really need to worry about 
it starting at 'd', as you can easily correct that later.  Eg this one:

smithi on sola% fdisk -s ad0
/dev/ad0: 77520 cyl 16 hd 63 sec
PartStartSize Type Flags
   1:   30240 

can't make an 'a' slice except with auto-defaults

2010-02-02 Thread Steve Franks
On a running system.  I mean, I know I should quit being a %^# and
read the manpage for bsdlabel, but sysintall really does have a nice
tui.'C'reate slice goes straight to 'd', even on a 'fresh' disk.
I see in the handbook, this is alluded to, but some intermediate level
between begginer and expert (bsdlabel just strikes me as way too easy
to trash the disk I'm running off of while trying to make a backup),
would be nice...512M just won't fit the kernel+symbols.

fuming, reading man bsdlabel ;) 

Steve
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org