format slice

Freek Nossin freeknossin at tiscali.nl
Sun Mar 13 03:52:07 PST 2005



> -----Original Message-----
> From: Alejandro Pulver [mailto:alejandro at varnet.biz]
> Sent: zondag 13 maart 2005 1:30
> To: Alejandro Pulver
> Cc: Freek Nossin; 'Jerry McAllister'; freebsd-questions at freebsd.org
> Subject: Re: format slice
> 
> On Sat, 12 Mar 2005 21:06:05 -0300
> Alejandro Pulver <alejandro at varnet.biz> wrote:
> 
> > On Sun, 13 Mar 2005 00:04:06 +0100
> > "Freek Nossin" <freeknossin at tiscali.nl> wrote:
> > > > > Then I used bsdlabel to create a label on ad0s1 by typing:
> > > > >
> > > > > #bsdlabel -w ad0s1
> > > > >
> > > > > And following the handbook, my next command was:
> > > > >
> > > > > #bsdlabel -e ad0s1
> > > > >
> > > > > Now I wrote in the text editor (I admit, after 4 tries and a lot
> > > > > of reading...):
> > > > >
> > > > > # /dev/ad0s1:
> > > > > 8 partitions:
> > > > > #        size   offset    fstype   [fsize bsize bps/cpg]
> > > > >   c: 20820177        0    unused        0     0         # "raw"
> > > > >   part, don't e: 20820177        0    4.2BSD     2048 16384
> > > > >   32776
> > > > >
> > > > >
> > > > > now I wanted to use newfs to create a file system on ad0s1e, but
> > > > > it could not. My problem is illustrated by my ls output:
> > > > >
> > > > > pcwin451# ls /dev/ad*
> > > > > /dev/ad0        /dev/ad0s2      /dev/ad0s2b     /dev/ad0s2d
> > > > > /dev/ad0s1      /dev/ad0s2a     /dev/ad0s2c     /dev/ad0s2e
> > > > >
> > > > > bsdlabel -e didn't create a new partition, although the output
> > > > > of bsdlabel ad0s1 is:
> > > > >
> > > > > pcwin451# disklabel ad0s1
> > > > > # /dev/ad0s1:
> > > > > 8 partitions:
> > > > > #        size   offset    fstype   [fsize bsize bps/cpg]
> > > > >   c: 20820177        0    unused        0     0         # "raw"
> > > > >   part, don't
> > > > > edit
> > > > >   e: 20820161       16    4.2BSD     2048 16384 32776
> > > > >
> > > > > How can this be? (and how do I fix it...?)
> > > > >
> > > > > Thanks for your help already so far
> > > > >
> > > > > Freek
> > > > >
> > > >
> > > > Hello,
> > > >
> > > > In my second disk I have free space between two slices so I tried
> > > > the procedure by myself.
> > > >
> > > > When I did a 'bsdlabel -w /dev/adXsY' (without editing them) I
> > > > ended with a partition labeled 'a', and it instantly appeared in
> > > > '/dev/'. Then I did what you have done ('bsdlabel -e <slice>') and
> > > > it also appeared in'/dev'.
> > > >
> > > > I do not know about this, but maybe this helps:
> > > >
> > > > 1) Try with only 'bsdlabel -w <slice>'. The partition should
> > > > appear as'a'.
> > > >
> > > > 2) If the partition does not appear in '/dev/' then you can
> > > > reinitialize the ATA channel (0 or 1, I think your disk is in 0)
> > > > your disk is in, with 'atacontrol reinit <channel>'. For a list of
> > > > ATA channels with the devices do 'atacontrol list'.
> > > >
> > > > ***WARNING***: do ***NOT*** 'detach' and 'attach' the channel your
> > > > device your running hard disk (that contain the FreeBSD you are
> > > > running) is connected to (but you can safely 'reinit' it). A
> > > > 'detach' removes the disk and slices/partitions from the kernel
> > > > and powers down the devices in that channel, so FreeBSD will stall
> > > > when it tries to read/write on its partitions ('/', '/usr', etc.).
> > > > I could detach and atach it once (in less than 5 seconds), but the
> > > > other time it crashed my machine (I had to rewrite this mail three
> > > > times, because I was experimenting with 'atacontrol'). It is more
> > > > safe to reboot the machine.
> > > >
> > > > Best Regards,
> > > > Ale
> > >
> > >
> > > Thank, but unfortunately it dit not help
> > >
> > > pcwin451# atacontrol reinit 0
> > > Master:  ad0 <Maxtor 5T020H2/TAH71DP0> ATA/ATAPI revision 6
> > > Slave:       no device present
> > >
> > > pcwin451# bsdlabel -w ad0s1
> > >
> > > pcwin451# ls /dev/ad*
> > > /dev/ad0        /dev/ad0s2      /dev/ad0s2b     /dev/ad0s2d
> > > /dev/ad0s1      /dev/ad0s2a     /dev/ad0s2c     /dev/ad0s2e
> > >
> > >
> > >
> > > _______________________________________________
> > > freebsd-questions at freebsd.org mailing list
> > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > > To unsubscribe, send any mail to
> > > "freebsd-questions-unsubscribe at freebsd.org"
> >
> > Hello,
> >
> > Have you tried to reinitialize the ata channel before changing the
> > partitions?
> >
> 
> Sorry, I mean after.
> 
> > Try unmounting '/dev' and mounting it again (forcing it with '-f').
> >
> > If the problem persist, the only alternative is to reboot. Do you have
> > a dynamic IP? If that is the case it is possible to add a crontab
> > entry that executes a script on each system startup. The script can
> > send you an e-mail to you using the internal sendmail (must be enabled
> > for that) relay so it will contain the IP of your server (in the
> > complete headers). Alternatively the script can upload a file
> > containing the output of 'ifconfig' to an FTP site.
> >
> > If you are interested you can ask me for more information.
> >
> > Best Regards,
> > Ale
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to
> > "freebsd-questions-unsubscribe at freebsd.org"

Hello, 

I did try to reinitialize the ata channel: no effect
I did try to unmount and mount /dev: no effect
Next on the list was: Shutdown -r now.

The reboot fortunately went well. But my problems weren't solved. Still
ad0s1a wasn't in /dev. 

#/stand/sysintall

Selecting fdisk showed that the first slice wasn't of type freebsd, but
unused. I selected "create" and went on to the labeller. I made a partition
and tried to write the changes. "ERROR". The same error as before. Back to
fdisk and only trying to make the slice resulted in the same (unspecific)
error "could not write to ad0". 

It appears that writing changes to the disk layout seems to be a problem,
and that fdisk/bsdlabel apparently don't see that there is a problem, they
return no error whatsoever, but they don't function as expected as well. 

Best Regards, 

Freek





More information about the freebsd-questions mailing list