Author Topic: Formatting external drive in FreeBSD  (Read 4582 times)

0 Members and 1 Guest are viewing this topic.

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Formatting external drive in FreeBSD
« on: July 25, 2006, 12:42:53 am »
Ok, I have found absolutely no fucking way to format a disk easily on FreeBSD.

It's super easy on Windows. It's super easy on Linux.

Come to FreeBSD, it's an absolute fucking pain in my ass.

Anybody wanna link me to the proper/correct/command line way to format a drive? Any drive. Preferably something like an iPod/thumbdrive/external hard-drive.

Thanks in advance. Google has failed me miserably.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline Blaze

  • x86
  • Hero Member
  • *****
  • Posts: 7136
  • Canadian
    • View Profile
    • Maide
And like a fool I believed myself, and thought I was somebody else...

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Formatting external drive in FreeBSD
« Reply #2 on: July 25, 2006, 09:46:52 am »
Try mkfs?  Or is that just Linux?

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Formatting external drive in FreeBSD
« Reply #3 on: July 25, 2006, 01:04:26 pm »
http://www.freebsd.org/doc/en_US.ISO8859-1/articles/formatting-media/article.html

?

No.

Try mkfs?  Or is that just Linux?

The thing is that fdisk refuses to work from the console. I have to go into sysinstall for it, and even then it acts really weird. I can only select from like, 3 filesystems. ext2fs, ufs, and dos. What if I want more?
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Formatting external drive in FreeBSD
« Reply #4 on: July 25, 2006, 01:11:40 pm »
Well, can't you partition it with fdisk (through that program or whatever), then run mkfs to create the file system?

Which FS are you trying to create, exactly? 

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Formatting external drive in FreeBSD
« Reply #5 on: July 25, 2006, 03:09:02 pm »
Well, can't you partition it with fdisk (through that program or whatever), then run mkfs to create the file system?

Which FS are you trying to create, exactly? 

No mkfs. I really have no idea how to format it via mkfs_xxxx ala Linux. I know how to format to UFS and FAT32 (newfs and newfs_msdos) but getting past this pain in the ass in fdisk would be a start...

Quote
newby@overkill:~$ sudo fdisk /dev/ad0
Password:
******* Working on device /dev/ad0 *******
parameters extracted from in-core disklabel are:
cylinders=193821 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=193821 heads=16 sectors/track=63 (1008 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 195366402 (95393 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
newby@overkill:~$

I used my hard-drive as an example, but it does that for everything.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Re: Formatting external drive in FreeBSD
« Reply #6 on: July 25, 2006, 04:59:33 pm »
http://lists.freebsd.org/pipermail/freebsd-questions/2005-May/087399.html

This seems to be what you want but you probably already saw it and didnt like it for some reason, no reason not to through it out there though.

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Formatting external drive in FreeBSD
« Reply #7 on: July 26, 2006, 02:06:47 am »
Yes. I know how to format an external hard-drive. I just need the fucking commands. I can look up the manual pages once I have them, but so far I have been failed.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Formatting external drive in FreeBSD
« Reply #8 on: August 10, 2006, 02:53:53 am »
Yes. I know how to format an external hard-drive. I just need the fucking commands. I can look up the manual pages once I have them, but so far I have been failed.

Do you want to zero out the disk or create a new partition?
You showed a snipit of fdisk...
If you want to do fdisk for FreeBSD on the entire disk
do:
fdisk -I /dev/da0

otherwise
for a new disk
do:
fdisk -i /dev/da0

or to modify an existing partition
fdisk -# -u /dev/da0

where # is the partition number

To zero out the drive, you could use dd
dd if=/dev/zero of=/dev/da0

Since BSD eliminated block devices, you do not need to specify the block size.

BTW:
If you want to make a UFS2 file system after you fdisk it
do: newfs /dev/da0s1
Although I strongly suggest you bsdlabel /dev/da0s first, otherwise the other BSDs can't read it.  A label is distinguished by a letter, e.g. da0s1a, once you label it do newfs on the label (e.g. newfs /dev/da0s1a).  To be brief, the other BSDs assume the partition is labelled which, if you just did 'newfs /dev/da0s1' will cause problems.
« Last Edit: August 10, 2006, 03:02:55 am by nslay »
An adorable giant isopod!

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Formatting external drive in FreeBSD
« Reply #9 on: August 10, 2006, 02:57:31 am »
I wanted to create a new partition. I'll look into those commands tomorrow.

How would I go about formatting the partition afterwards?
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Formatting external drive in FreeBSD
« Reply #10 on: August 10, 2006, 03:43:44 am »
I wanted to create a new partition. I'll look into those commands tomorrow.

How would I go about formatting the partition afterwards?

newfs takes care of those details.
newfs /dev/da0s1
will create a UFS2 FS for you...I think -o 1 will make it UFS1
be sure to bsdlabel it beforehand, otherwise Net and OpenBSD will not be able to read the FS.
Although, you may use it without labeling it in FreeBSD
« Last Edit: August 10, 2006, 03:47:21 am by nslay »
An adorable giant isopod!