Re: Reformatting external harddrive

2009-05-13 Thread Polytropon
On Tue, 12 May 2009 22:04:35 -0400, Daniel Underwood  
wrote:
> According to the newfs manpages, you can specify a filesystem type
> (-O) and a disktype (-T) for "backward compatibility." It further
> appears that -O can only designate either UFS1 or UFS2.  I don't quite
> know what the -T option designates; i.e., back compatible with "what"?

The -O 2 (default) would be the best solution I think. UFS2 is the
standard in FreeBSD.

And yes, I forgot to mention this: After formatting the drive, you
will surely want to enable soft updates. Use the command

# tunefs -n enable /dev/da0

to do this. Refer to "man tunefs" for more information, for example
if you wish to set minfree to another than the default value, or
the optimization for either space or time.

The -T  is mentioned in /usr/src/sbin/newfs/newfs.c line 388
cont. and of course in the getopt() selector at the beginning of the
newfs program.



> (I ask about the -O and -T options becase I would like to use this
> harddrive on both my FreeBSD and my linux machine.)

I'm not sure if Linux is able to use UFS... (I don't use Linux, so
I really can't tell.).



-- 
Polytropon
>From 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: Reformatting external harddrive

2009-05-12 Thread Daniel Underwood
Thanks guys, this is perfect.

According to the newfs manpages, you can specify a filesystem type
(-O) and a disktype (-T) for "backward compatibility." It further
appears that -O can only designate either UFS1 or UFS2.  I don't quite
know what the -T option designates; i.e., back compatible with "what"?

(I ask about the -O and -T options becase I would like to use this
harddrive on both my FreeBSD and my linux machine.)

Thanks,
Daniel
___
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: Reformatting external harddrive

2009-05-12 Thread Jerry McAllister
On Tue, May 12, 2009 at 01:41:37PM -0400, Daniel Underwood wrote:

> Thanks for all the advice. This evening, when I get home to work, I
> will try these suggestions.
> 
> I have no idea why there is more than 1 partition on this disk. I must
> have inadvertently created multiple partitions when I was struggling
> to reformat this disk in linux.  Every time I tried to fdisk (or
> perhaps it was mkfs.ext3) on in linux, I got errors about a "bad
> superblock" (which I understand somehow relates to the journaling
> mechanism of ext3).

According to the fdisk output you include, there is only 1 slice (called
primary partition in MS land) being used on the disk.   
It has about 305242 MegaBytes which seems to be what you are looking for.

It is possible to have up to 4 slices (primary partitions) on a disk.
The fdisk output shows one being used and the other three empty and
not being used.So, you are all fine.

Ignore those bogus messages about BIOS and partitions not in cyl 1, etc.
They are not relevant.


You can now either use bsdlabel to create partitions within that slice
or just use the slice as is.   In either case, you have to newfs the
unit to create a filesystem in it so you can mount it and write/read it.

If you use it as is without creating partitions, then do:
  newfs /dev/da0s1

If you create one single partition within that slice - say a: for example
then the newfs would be:
  newfs /dev/da0s1a

If you create partitions, lets say a:, d: and e: then do:

  newfs /dev/da0s1a
  newfs /dev/da0s1d
  newfs /dev/da0s1e

In any case, to not use  partition  c:   and for sanity's sake
avoid  b: .c:  is reserved to describe the whole slice and, by 
convention, b:  is used for swap though that is not required.
Some people suggest avoiding  a:  because it is most often a 
bootable partition.   It is not required either, but it can reduce
confusion to avoid it in non-bootable slices/disks.

If your backups are small enough so more than one full dump can
fit on the disk, then I suggest slicing and partitioning so that
each full dump series can have its own partition.  It is not a
requirement.  It is just easier to keep track of on those groggy
odd hours.

jerry

> >>
> >> *** Working on device /dev/da0 ***
> >> parameters extracted from in-core disklabel are:
> >> cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)
> >>
> >> Figures below won't work with BIOS for partitions not in cyl 1
> >> parameters to be used for BIOS calculations are:
> >> cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)
> >>
> >> Media sector size is 512
> >> Warning: BIOS sector numbering starts with sector 1
> >> Information from DOS bootblock is:
> >> The data for partition 1 is:
> >> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
> >>    start 63, size 625137282 (305242 Meg), flag 80 (active)
> >>        beg: cyl 0/ head 1/ sector 1;
> >>        end: cyl 0/ head 254/ sector 63
> >> The data for partition 2 is:
> >> 
> >> The data for partition 3 is:
> >> 
> >> The data for partition 4 is:
> >> 
> >
___
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: Reformatting external harddrive

2009-05-12 Thread Daniel Underwood
Awesome. This is exactly the advice I need. Thanks!
___
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: Reformatting external harddrive

2009-05-12 Thread Polytropon
On Tue, 12 May 2009 13:41:37 -0400, Daniel Underwood  
wrote:
> I have no idea why there is more than 1 partition on this disk.

I think I just saw one partition (slice in FreeBSD) in your output.

> The data for partition 1 is:
> [blah]
> The data for partition 2 is:
> 
> The data for partition 3 is:
> 
> The data for partition 4 is:
> 



> Every time I tried to fdisk (or
> perhaps it was mkfs.ext3) on in linux, I got errors about a "bad
> superblock" (which I understand somehow relates to the journaling
> mechanism of ext3).

UFS has superblocks, too.



> Therefore it is my hope that by reverting to the lowest level tools in
> FreeBSD to reformat the drive (if that's even the appropriate step to
> take) I can reclaim the ~300GB drive for external storage/backups.

These tools are basic tools, not lowest level. In fact, they operate
on a very high level of functionality. :-)

If you want to use the disk as an external backup storage, the simplest
thing is to

# newfs /dev/da0

and then just mount it. If you're not going to slice and partition it,
there's no need for fdisk or bsdlabel. The device /dev/da0, formerly
/dev/da0c, refers to "the one whole partition on DA device 0", as
/dev/da0s1c would refer to "the one whole partition covering the
1st slice of DA device 0"; you can, however, have more than one
slice on that disk, and different partitions within each slice,
such as /dev/da0s2g. But according to your requirement for a backup
storage, using the whole disk altogether would surely be the best
choice.

You can then enter a line like

/dev/da0/backup ufs rw,noauto   2   2

in your /etc/fstab, and then use

# mount /backup

do your backups or recoveries, e. g. with cpdup or tar, then use

# umount /backup

It's quite simple to do so. :-)




-- 
Polytropon
>From 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: Reformatting external harddrive

2009-05-12 Thread Daniel Underwood
Thanks for all the advice. This evening, when I get home to work, I
will try these suggestions.

I have no idea why there is more than 1 partition on this disk. I must
have inadvertently created multiple partitions when I was struggling
to reformat this disk in linux.  Every time I tried to fdisk (or
perhaps it was mkfs.ext3) on in linux, I got errors about a "bad
superblock" (which I understand somehow relates to the journaling
mechanism of ext3).

Therefore it is my hope that by reverting to the lowest level tools in
FreeBSD to reformat the drive (if that's even the appropriate step to
take) I can reclaim the ~300GB drive for external storage/backups.

On Tue, May 12, 2009 at 12:01 PM, Matthew Seaman
 wrote:
> Daniel Underwood wrote:
>>
>> After unsuccessfully trying to reformat my external harddrive on my
>> linux machine, I'm trying to reformat the disk in FreeBSD.  Frankly, I
>> just don't know how to do that. Please help me get the disk back to
>> working order; I don't need to keep any data that is currently on the
>> disk.
>>
>> The command
>>
>> $ /dev/da0
>
> ITYM: fdisk /dev/da0
>
>> gives the following output:
>>
>> *** Working on device /dev/da0 ***
>> parameters extracted from in-core disklabel are:
>> cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)
>>
>> Figures below won't work with BIOS for partitions not in cyl 1
>> parameters to be used for BIOS calculations are:
>> cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)
>>
>> Media sector size is 512
>> Warning: BIOS sector numbering starts with sector 1
>> Information from DOS bootblock is:
>> The data for partition 1 is:
>> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
>>    start 63, size 625137282 (305242 Meg), flag 80 (active)
>>        beg: cyl 0/ head 1/ sector 1;
>>        end: cyl 0/ head 254/ sector 63
>> The data for partition 2 is:
>> 
>> The data for partition 3 is:
>> 
>> The data for partition 4 is:
>> 
>
> This says that you have written a partition table onto the drive that
> indicates the whole disk is being used for FreeBSD.  That's a good
> start if your intention is to use the disk dedicated for FreeBSD.
>
> The way the partition naming scheme works you should now have a /dev/da0s1
> device file (indicating 'slice 1' or disk 'da0')
>
> In order to make the disk usable with FreeBSD, you need to follow something
> like these steps:
>
>  * Use bsdlabel(8) to create BSD partitions on slice1.  To write a
>  default label:
>
>        # bsdlabel -w /dev/da0s1
>
>    Then to edit the default label and define the partitions you want,
>
>        # bsdlabel -e da0s1
>
>    Edit mode will pop up an editor with the existing BSD partition
>    table -- that's vi(1) by default but you can override it by setting the
>    EDITOR environment variable.
>
>    If your aim is to use this disk as one big filesystem for storing data
>    then creating a 'd' partition covering all the available space would be
>    appropriate.  After saving the edited partition table you should now have
>    a device file:
>
>        /dev/da0s1d
>
>  * Use newfs(8) to create a filesystem on the drive.  I'd just leave it with
>    the default settings unless you know you're going to be using the disk
>  for unusually large files or unusually many very small files.
>
>        newfs /dev/da0s1d
>
>  * Mount the new filesystem to make it available to FreeBSD.  Add a line
> like
>    the following to /etc/fstab:
>
>        /dev/da0s1d    /data    ufs    rw    2    2
>
>     Then create the mount point:
>
>       # mkdir -p /data
>
>     and mount the drive:
>
>       # mount /data
>
>     The drive will be remounted automatically on system reboots and is
> expected
>     to be permanently present.  If you want to have the disk be removable,
> then
>     read all about amd(8) and feel free to ask again here.
>
>        Cheers,
>
>        Matthew
>
> --
> Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
>                                                 Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
>                                                 Kent, CT11 9PW
>
>
___
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: Reformatting external harddrive

2009-05-12 Thread Matthew Seaman

Daniel Underwood wrote:

After unsuccessfully trying to reformat my external harddrive on my
linux machine, I'm trying to reformat the disk in FreeBSD.  Frankly, I
just don't know how to do that. Please help me get the disk back to
working order; I don't need to keep any data that is currently on the
disk.

The command

$ /dev/da0


ITYM: fdisk /dev/da0


gives the following output:

*** Working on device /dev/da0 ***
parameters extracted from in-core disklabel are:
cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 63, size 625137282 (305242 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 0/ head 254/ sector 63
The data for partition 2 is:

The data for partition 3 is:

The data for partition 4 is:



This says that you have written a partition table onto the drive that
indicates the whole disk is being used for FreeBSD.  That's a good
start if your intention is to use the disk dedicated for FreeBSD.

The way the partition naming scheme works you should now have a /dev/da0s1
device file (indicating 'slice 1' or disk 'da0')

In order to make the disk usable with FreeBSD, you need to follow something
like these steps:

  * Use bsdlabel(8) to create BSD partitions on slice1.  To write a 
default label:


# bsdlabel -w /dev/da0s1

Then to edit the default label and define the partitions you want,

# bsdlabel -e da0s1

Edit mode will pop up an editor with the existing BSD partition
table -- that's vi(1) by default but you can override it by setting the
EDITOR environment variable.

If your aim is to use this disk as one big filesystem for storing data
then creating a 'd' partition covering all the available space would be
appropriate.  After saving the edited partition table you should now have
a device file:

/dev/da0s1d

  * Use newfs(8) to create a filesystem on the drive.  I'd just leave it with
the default settings unless you know you're going to be using the disk 
for unusually large files or unusually many very small files.


newfs /dev/da0s1d

  * Mount the new filesystem to make it available to FreeBSD.  Add a line like
the following to /etc/fstab:

/dev/da0s1d/dataufsrw22

 Then create the mount point:

   # mkdir -p /data

 and mount the drive:

   # mount /data

 The drive will be remounted automatically on system reboots and is expected
 to be permanently present.  If you want to have the disk be removable, then
 read all about amd(8) and feel free to ask again here.

Cheers,

Matthew

--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Reformatting external harddrive

2009-05-12 Thread Polytropon
On Mon, 11 May 2009 21:18:13 -0400, Daniel Underwood  
wrote:
> After unsuccessfully trying to reformat my external harddrive on my
> linux machine, I'm trying to reformat the disk in FreeBSD.  Frankly, I
> just don't know how to do that.

The command

# newfs /dev/da0

should reformat the disk. You end up with one partition covering
the whole disk. There's no need to put a slice on it (with a
partition in it) when you're not going to boot from that disk.


> The command
> 
> $ /dev/da0

Souldn't it be

# fdisk da0

because you're presenting a fdisk output?



> gives the following output:
> 
> *** Working on device /dev/da0 ***
> The data for partition 1 is:
> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
> start 63, size 625137282 (305242 Meg), flag 80 (active)
>   beg: cyl 0/ head 1/ sector 1;
>   end: cyl 0/ head 254/ sector 63

There's a FreeBSD partition on that disk.

Which files do you have in /dev?

# ll /dev/da0*

Maybe you just need to newfs /dev/da0s1{a,c,d,e,...?}.



-- 
Polytropon
>From 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: Reformatting external harddrive

2009-05-12 Thread Mel Flynn
On Tuesday 12 May 2009 03:18:13 Daniel Underwood wrote:
> After unsuccessfully trying to reformat my external harddrive on my
> linux machine, I'm trying to reformat the disk in FreeBSD.  Frankly, I
> just don't know how to do that. Please help me get the disk back to
> working order; I don't need to keep any data that is currently on the
> disk.

> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
> start 63, size 625137282 (305242 Meg), flag 80 (active)
>   beg: cyl 0/ head 1/ sector 1;
>   end: cyl 0/ head 254/ sector 63

And what's not working? this shows a 30G FreeBSD partition?
-- 
Mel
___
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"


Reformatting external harddrive

2009-05-11 Thread Daniel Underwood
After unsuccessfully trying to reformat my external harddrive on my
linux machine, I'm trying to reformat the disk in FreeBSD.  Frankly, I
just don't know how to do that. Please help me get the disk back to
working order; I don't need to keep any data that is currently on the
disk.

The command

$ /dev/da0

gives the following output:

*** Working on device /dev/da0 ***
parameters extracted from in-core disklabel are:
cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=38913 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 63, size 625137282 (305242 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 0/ head 254/ sector 63
The data for partition 2 is:

The data for partition 3 is:

The data for partition 4 is:

___
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"