View Single Post
Old 18th January 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,132
Default

When you formatted the USB stick with NTFS it was recognized. That is why I suggest to do this again. Then with FreeBSD's fdisk you change the partition type from NTFS to FAT32

Fdisk output concerning one of my USB sticks
Code:
#  fdisk da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=244 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=244 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 6 (0x06),(Primary 'big' DOS (>= 32MB))
    start 32, size 3932128 (1919 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 960/ head 128/ sector 32
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
My stick already has partition identifier 6, which stands for the MSDOS filesystem. Yours probably will have a '7' for NTFS as ID.
So the task is simple, change this ID from 7 to 6 .

In the following I will change the partition ID 6 of my stick to OpenBSD's ID 166.
Code:
# fdisk -u da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=244 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=244 heads=255 sectors/track=63 (16065 blks/cyl)

Do you want to change our idea of what BIOS thinks ? [n] enter
We accept FreeBSD's interpretation of the BIOS.

Code:
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 6 (0x06),(Primary 'big' DOS (>= 32MB))
    start 32, size 3932128 (1919 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 960/ head 128/ sector 32
Do you want to change it? [n] y enter
Yes, I want to change this entry.

Code:
Supply a decimal value for "sysid (165=FreeBSD)" [6] 166
Supply a decimal value for "start" [32] 63
Supply a decimal value for "size" [3932128] 
fdisk: WARNING: partition does not end on a cylinder boundary
fdisk: WARNING: this may confuse the BIOS or some operating systems
Correct this automatically? [n] y enter
I change the ID from 6 (FAT32) to 166 (OpenBSD) and allow fdisk to align the partition end on a cylinder boundary.

Code:
fdisk: WARNING: adjusting size of partition to 3919797
Explicitly specify beg/end address ? [n] 
sysid 166 (0xa6),(OpenBSD)
    start 63, size 3919797 (1913 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 243/ head 254/ sector 63
Are we happy with this entry? [n] y enter
Yes, we are happy

Code:
The data for partition 2 is:
<UNUSED>
Do you want to change it? [n] enter

The data for partition 3 is:
<UNUSED>
Do you want to change it? [n]  enter

The data for partition 4 is:
<UNUSED>
Do you want to change it? [n] enter

Partition 1 is marked active
Do you want to change the active partition? [n]  enter
The remaining empty partitions/slices we leave untouched. And partition/slice 1 can stay the active partition.

Code:
We haven't changed the partition table yet.  This is your last chance.
parameters extracted from in-core disklabel are:
cylinders=244 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=244 heads=255 sectors/track=63 (16065 blks/cyl)

Information from DOS bootblock is:
1: sysid 166 (0xa6),(OpenBSD)
    start 63, size 3919797 (1913 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 243/ head 254/ sector 63
2: <UNUSED>
3: <UNUSED>
4: <UNUSED>
Should we write new partition table? [n] y enter
After entering "y" here the MBR gets updated and the stick will have been marked, having an OpenBSD partition. Of course, I still need to format this OpenBSD partition on an OpenBSD sytem with newfs.

So you task is the change the NTFS sysid to 06. When that is done you format that slice with FreeBSD's newfs_msdos.
Code:
# newfs_msdos /dev/da0s1
Problem solved, I hope
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote