PDA

View Full Version : [Solved] Creating a Device file /dev/ad4s5


quakerdoomer
April 14th, 2009, 10:44
I don't find the MAKEDEV or any similar script/binary on FreeBSD 8.0 CURRENT 200902 Release. I need help with creating a device file /dev/ad4s5 (which unlike ad2,ad3,..etc.. strangely doesn't exist by default) for my Windows NTFS D DRIVE.

adamk
April 14th, 2009, 10:46
You don't create devices in FreeBSD these days. The device filesystem will create devices when detected. If /dev/ad4s5 doesn't exist, then the kernel doesn't see that slice. Are you sure that's the correct device name for your D drive?

Adam

quakerdoomer
April 14th, 2009, 11:16
Yes even I was guessing that it should autocreate it. But the same slice gets detected by DesktopBSD as ad4s5. Any idea how to force FreeBSD to map it ?
Will replacing any disk related config file from DesktopBSD help here ?

f-andrey
April 14th, 2009, 12:08
Show
> fdisk -t
or
> gpart show

quakerdoomer
April 14th, 2009, 18:44
From Windows my Disk View is :
78.2 MB C:
45.8 MB D:
55.8 GB E:

== gpartshowout ==

=> 63 234441585 ad4 MBR (112G)
63 160587 1 !6 (78M)
160650 20964825 2 freebsd [active] (10G)
21125475 7837 - free - (3.8M)
21133312 117188608 3 !7 (56G)
138321920 96114625 4 !15 (46G)
234436545 5103 - free - (2.5M)

=> 0 20964825 ad4s2 BSD (10G)
0 18866176 1 freebsd-ufs (9.0G)
18866176 2098649 2 freebsd-swap (1.0G)

=> 0 96114625 ad4s4 BSD (46G)
0 524288 1 freebsd-ufs (256M)
524288 1048576 2 freebsd-swap (512M)
1572864 1048576 4 freebsd-ufs (512M)
2621440 10565655 5 freebsd-ufs (5.0G)
13187095 82927530 - free - (40G)

=> 32 1001440 da0 MBR (489M)
32 31 - free - (16K)
63 1001409 1 !12 [active] (489M)




== END OF gpartshowout ==
gpart show thinks there is 40 GB Free space in ad4s4.. weird !
Also says 138321920 96114625 4 !15 (46G)

Here is the "fdisk -t" output
== fdisk-tout ==

******* Working on device /dev/ad4 *******
parameters extracted from in-core disklabel are:
cylinders=232581 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=232581 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 6 (0x06),(Primary DOS, 16 bit FAT (>= 32MB))
start 63, size 160587 (78 Meg), flag 0
beg: cyl 0/ head 1/ sector 1;
end: cyl 9/ head 254/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 160650, size 20964825 (10236 Meg), flag 80 (active)
beg: cyl 10/ head 0/ sector 1;
end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
start 21133312, size 117188608 (57221 Meg), flag 0
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 36/ sector 2
The data for partition 4 is:
sysid 15 (0x0f),(Extended DOS (LBA))
start 138321920, size 96114625 (46930 Meg), flag 0
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 254/ sector 63


== END of fdisk-tout ==

graudeejs
April 14th, 2009, 20:56
/dev/ad4s5
is not possible, because x86 is limited to 4 slices.

But if you are using gpt partitions then you can have up to 128 (or 127, don't remember) of them.

perhaps it was /dev/ad4p5
?

adamk
April 14th, 2009, 22:05
/dev/ad4s5
is not possible, because x86 is limited to 4 partitions.


You can certainly have slices beyond s4:


[ adamk@sorrow - /dev ]: ls -1 /dev/ad6s*
/dev/ad6s1
/dev/ad6s2
/dev/ad6s2a
/dev/ad6s2b
/dev/ad6s2c
/dev/ad6s2d
/dev/ad6s2e
/dev/ad6s2f
/dev/ad6s2g
/dev/ad6s5
/dev/ad6s6
/dev/ad6s7
/dev/ad6s8


Logical partitions will show up as s5 and higher.

Adam

graudeejs
April 14th, 2009, 23:20
yes, logical will

Djn
April 14th, 2009, 23:25
yes, logical will
He's got an extended partition there, so it's probably inside that.

Logical partitions have been slightly iffy for me lately - not that that's specific enough to help ...

quakerdoomer
April 15th, 2009, 06:00
DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 F FreeBSD_Ins CDFS DVD-ROM 927 MB
Volume 1 C FAT Partition 78 MB Healthy System
Volume 2 E NTFS Partition 56 GB Healthy Boot
Volume 3 D OverHead NTFS Partition 46 GB Healthy

DISKPART> list partition

Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 78 MB 32 KB
Partition 2 Unknown 10 GB 78 MB
Partition 3 Primary 56 GB 10 GB
Partition 4 Extended 46 GB 66 GB
Partition 5 Logical 46 GB 66 GB



D Drive is Extended Logical indeed. Can we declare this as a yet to be resolved FreeBSD 8.0 CURRENT bug ?

f-andrey
April 15th, 2009, 19:32
perhaps it was /dev/ad4p5?

# mount_ntfs /dev/ad4p4 /mnt
not work?

show
> ls /dev/ | grep ad

quakerdoomer
April 16th, 2009, 12:23
ad4
ad4s1
ad4s2
ad4s2a
ad4s2b
ad4s3
ad4s4
ad4s4a
ad4s4b
ad4s4d
ad4s4e

SirDice
April 16th, 2009, 12:27
/dev/ad4s5
is not possible, because x86 is limited to 4 partitions.
4 Primary DOS partitions (aka bsd slices), yes. s5 is inside an Extended DOS Partition.

But if you are using gpt partitions then you can have up to 128 (or 127, don't remember) of them.
You are confusing slices and partitions.

f-andrey
April 16th, 2009, 13:13
From Windows my Disk View is :
78.2 MB C:
45.8 MB D:
55.8 GB E:

If we look gpart show

78.2 MB C: = ad4s1
55.8 GB E: = ad4s3
ad4s2a-b and ad4s4a-e free bsd partitions.

You may be install FreeBSD on disk D: and format his "ad4s4 BSD (46G)" = "Volume 3 D OverHead NTFS Partition 46 GB Healthy" :q

quakerdoomer
April 17th, 2009, 06:09
Yes OverHead is D: 46 GB
But according to gpart the scene is :
ad4s4 BSD (46G)
gpart on BSD seems to misread it and shows - free - (40G) which is what actually FreeBSD 8.0 CUrrent thinks is true. I want to mount the D Drive :-(

Djn
April 17th, 2009, 07:47
Yes OverHead is D: 46 GB
But according to gpart the scene is :
ad4s4 BSD (46G)
gpart on BSD seems to misread it and shows - free - (40G) which is what actually FreeBSD 8.0 CUrrent thinks is true. I want to mount the D Drive :-(

Mh, I ran into this as well when fiddling with installing to a logical partition.
Try kldloading geom_part_mbr and see what happens?

quakerdoomer
April 17th, 2009, 18:13
kldload ./???????
I'm afraid I didn't get that one.

Djn
April 17th, 2009, 18:28
Unless I'm not mistaken: kldload geom_part_mbr

Not entirely sure what will happen - it should in theory already be active, but loading it made more partitions show up for me.

quakerdoomer
April 18th, 2009, 18:11
DIGITAL-TRAITOR# kldload geom_part_mbr
kldload: can't load geom_part_mbr: File exists


Some more interesting lines from dmesg output :


GEOM: ad4: partition 4 does not start on a track boundary.
GEOM: ad4: partition 4 does not end on a track boundary.
GEOM: ad4: partition 3 does not start on a track boundary.
GEOM: ad4: partition 3 does not end on a track boundary.
GEOM_LABEL: Label for provider ad4s1 is msdosfs/DellUtility.
GEOM: ad4s2: geometry does not match label (255h,63s != 16h,63s).
GEOM: ad4s4: media size does not match label.

graudeejs
April 18th, 2009, 23:45
You are confusing slices and partitions.

ye, your right my mistake


ad1 - disk 1
ad1s2 - slice 2 on disk 1
ad1s2d - label d on slice 2 on disk 1

ad2 - disk 2
ad2p1 - disk 2, GUID partition 1

quakerdoomer
September 29th, 2009, 13:02
A small update to those involved in this thread :

ad4s1 is C:
ad4s3 is E:
On DesktopBSD and PCBSD I see D: as ad0s5

I remember replacing 8.0-CURRENT June release with an old untarred Feb Archive. This gave me access to ad4s5 (or was it ad4s4 ?? )

I am now using RC1 but I still unlucky with D:
The fdisk output is the same as mentionbed above in April
I don't know what's goin on.

I see ad4s4 and devices from ad4s4a to ad4s4e
uname output :

FreeBSD DIGITAl-TRAITOR 8.0-RC1 FreeBSD 8.0-RC1


Will deleting the partition and converting it to FAT32 help me ?

aragon
September 29th, 2009, 17:37
On your RC1 system, paste the output of:


fdisk /dev/ad4


and


ls /dev/ad4*

quakerdoomer
September 30th, 2009, 08:02
******* Working on device /dev/ad4 *******
parameters extracted from in-core disklabel are:
cylinders=232581 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=232581 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 6 (0x06),(Primary DOS, 16 bit FAT (>= 32MB))
start 63, size 160587 (78 Meg), flag 0
beg: cyl 0/ head 1/ sector 1;
end: cyl 9/ head 254/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 160650, size 20964825 (10236 Meg), flag 80 (active)
beg: cyl 10/ head 0/ sector 1;
end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
start 21133312, size 117188608 (57221 Meg), flag 0
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 36/ sector 2
The data for partition 4 is:
sysid 15 (0x0f),(Extended DOS (LBA))
start 138321920, size 96114625 (46930 Meg), flag 0
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 254/ sector 63





/dev/ad4
/dev/ad4s1
/dev/ad4s2
/dev/ad4s2a
/dev/ad4s2b
/dev/ad4s3
/dev/ad4s4
/dev/ad4s4a
/dev/ad4s4b
/dev/ad4s4d
/dev/ad4s4e

aragon
September 30th, 2009, 08:39
And fdisk /dev/ad4s4 ?

quakerdoomer
September 30th, 2009, 12:01
DIGITAL-TRAITOR# fdisk /dev/ad4s4
******* Working on device /dev/ad4s4 *******
parameters extracted from in-core disklabel are:
cylinders=95351 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=95351 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 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
start 63, size 96114562 (46930 Meg), flag 0
beg: cyl 1023/ head 37/ sector 3;
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>
DIGITAL-TRAITOR#



..which I think is very weird. Windows sees D drive as 45.8 GB

aragon
October 1st, 2009, 02:26
What's strange for me is that ad4s4 is an extended partition with a NTFS logical partition in it, yet FreeBSD seems to think it's a UFS partition. You shouldn't have ad4s4a, b, etc. - should be just ad4s4 and ad4s5.

Out of interest, what does "bsdlabel ad4s4" say?

You might want to post to one of the mailing lists and/or file a PR about this...

quakerdoomer
October 1st, 2009, 07:13
DIGITAL-TRAITOR# bsdlabel ad4s4
# /dev/ad4s4:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 524288 0 4.2BSD 2048 16384 32776
b: 1048576 524288 swap
c: 13187095 0 unused 0 0 # "raw" part, don't edit
d: 1048576 1572864 4.2BSD 2048 16384 8
e: 10565655 2621440 4.2BSD 2048 16384 28552
bsdlabel: partition c doesn't cover the whole unit!
bsdlabel: An incorrect partition c may cause problems for standard system utilities
DIGITAL-TRAITOR#

aragon
October 1st, 2009, 07:50
At some point in time, was that 4th partition a BSD partition before you made it an extended logical NTFS partition?

quakerdoomer
October 1st, 2009, 12:03
According to Windows XP Logical Disk Manager Service the 4th Partition is not an Extended one.
I have 4 partition and all are Primary ones.
C: (78MB)
UFS (10GB) Unknown as per Windows
E: 55.88 GB
D: 45.83 GB

I don't have any extended ones and the 4th one was never a BSD partition, it was just Free space.

quakerdoomer
October 6th, 2009, 12:18
I solved it. I deleted the D DRIVE PARTITION completely. Now I again had free space. I Recreated the same partition with same amount of size and now I do see /dev/ad4s5.

I don't know how many have faced tis but ntfs-3g (fusefs) if used to mount a NTFS Drive has to be safely unmounted else your files disappear and you need to run chkdsk X: /F

THANKS to everyone involved in this thread.