DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th February 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 45
Default Strange fdisk and mounting question

Hello, BSD users! I have an odd question, and I'm not entirely sure where to post it, or where to look for pointers.

My system (A Dell Dimension 4550 series) has three hard drives and one DVD-Rom on the IDE bus. The first disk (BSD calls it ad0) has Windows-XP. The second (ad1) has PC-BSD 8.2. The DVD-Rom appears to be holding ad2's "spot." Clearly BSD can mount it's own disk, and I have been able to manually mount the Windows-XP drive. The problem is with the third drive, ad3.

When I do an fdisk on /dev/ad3 (to see if the system even knows the disk is there), it gives me a readout of the two Fat32 partitions I have on it. Nothing unexpected there. However, I can't mount either of these partitions. When I look in /dev, I see an entry for ad3, but not for the two partitions. I was expecting something along the lines of ad3s1 & ad3s2, or ad3p1 & ad3p2. In my previous BSD install (7.2), I had ad3s1 & ad3s2, but 8.2 doesn't provide them.

It's important that BSD be able to read the third drive. That's where most of my work files are. I put them this Fat32 partition because both of my OS's can use it without doing anything fancy.

How can I go about implementing this? I know that 8.2 has some elaborate labeling conventions, so this may be quite simple, but I don't know where to start. I haven't yet found an FAQ, man, or forum thread that clearly answers this. I suspect I'm overlooking something painfully obvious.

How should I proceed? Thanks in advance.


RJPugh
Reply With Quote
  #2   (View Single Post)  
Old 28th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

What is the output of # fdisk /dev/ad3? And # ls -l /dev/ad3*
Then we have some hard facts to work on.
__________________
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
  #3   (View Single Post)  
Old 28th February 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 45
Default

fdisk /dev/ad3

******* Working on device /dev/ad3 *******
parameters extracted from in-core disklabel are:
cylinders=310101 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=310101 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 11 (0x0b),(DOS or Windows 95 with 32 bit FAT)
start 63, size 153790182 (75092 Meg), flag 0
beg: cyl 0/ head 1/ sector 1;
end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 11 (0x0b),(DOS or Windows 95 with 32 bit FAT)
start 153790245, size 158786460 (77532 Meg), flag 0
beg: cyl 1023/ head 254/ sector 63;
end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>


ls -l /dev/ad3*


crw-rw-rw- 1 root operator 0, 92 Feb 27 23:18 /dev/ad3
Reply With Quote
  #4   (View Single Post)  
Old 28th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Very strange indeed. I had a spare USB stick lying and under OpenBSD I split the one big FAT32 partition in two.
I bought the disk with the weird offset of 8046, so I left it that way.
The dmesg after inserting the stick :

Code:
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: < USB DISK 2.0 PMAP> Removable Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: 3824MB (7831552 512 byte sectors: 255H 63S/T 487C)
GEOM: da0: partition 2 does not start on a track boundary.
GEOM: da0: partition 2 does not end on a track boundary.
GEOM: da0: partition 1 does not end on a track boundary.
The fdisk output:

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

parameters to be used for BIOS calculations are:
cylinders=487 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 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
    start 8064, size 3907712 (1908 Meg), flag 0
        beg: cyl 0/ head 128/ sector 1;
        end: cyl 243/ head 190/ sector 11
The data for partition 2 is:
sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
    start 3915776, size 3915776 (1912 Meg), flag 0
        beg: cyl 243/ head 190/ sector 12;
        end: cyl 487/ head 125/ sector 22
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
Note that you have a partition identifier/sysid of 11 decimal while I have 12 decimal. And I see '(LBA)' while you have not.

The '/dev/' output:
Code:
# ls -l /dev/da0*
crw-r-----  1 root  operator    0, 124 Feb 28 03:02 /dev/da0
crw-r-----  1 root  operator    0, 125 Feb 28 03:02 /dev/da0s1
crw-r-----  1 root  operator    0, 126 Feb 28 03:02 /dev/da0s2
I can mount both slice 1 and slice 2 without problem.
Code:
 # mount -o ro /dev/da0s1 /mnt
# ls -l /mnt
total 4620
-rwxr-xr-x  1 root  wheel  4726450 Feb 28 02:42 moderate_users_2.xwd
-rwxr-xr-x  1 root  wheel      191 Feb 28 02:42 reminders.txt
I am using FreeBSD 8.2-RC3.

You can burn a 7.2 fixit or livefs CD and see whether you can mount the disk partitions from there. Then try the fixit CD from to 7.3 and 7.4. When those still work try 8.0, and 8.1. That way you can discover where it went wrong and file a bug report.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 28th February 2011 at 06:49 AM. Reason: Added livefs CD alternative
Reply With Quote
  #5   (View Single Post)  
Old 28th February 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 45
Default

Thanks. I'll look into this further.

However, the absence of LBA on my troublesome drive raises other concerns. I may opt to rebuild that drive, making sure LBA is in place. If I do this, will FreeBSD detect the changes? And, will it make the appropriate changes to /dev? (i.e. create device files for the partitions).

Is there a command that I can use to force the creation of these? If it proves necessary?
Reply With Quote
  #6   (View Single Post)  
Old 28th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

If 7.2 sees those two FAT partitions and you could mount them, then I would not touch them. It could be a regression in FreeBSD 8.2 or earlier.
__________________
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
  #7   (View Single Post)  
Old 28th February 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

To simply toggle the identifiers from 0xb to 0xc wouldn't damage any data, it also does not indicate that "LBA is unsupported" by the drive.. LBA is just a logical notation for counting disk sectors (..if it detected your drive was smaller than 2/8GB, then perhaps maybe. ).

However, the area of the FreeBSD kernel responsible for probing disks with foreign partitions might not care about that difference.. it could be perhaps related to the actual filesystem structure, indeed it may be a bug.

You'll have better luck reporting things like things using the proper channels, i.e: mailing lists.. bug tracker.. etc.
Reply With Quote
  #8   (View Single Post)  
Old 1st March 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 45
Default

Toggling the lba tags didn't make a difference in BSD, in so far as mounting is concerned. Fdisk, however, noticed the change.

Is there anything else I can try to get FreeBSD to see those partitions? Can I "force" it to general device files?
Reply With Quote
  #9   (View Single Post)  
Old 1st March 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

When 7.2 could see and mount these partitions automatically and without any doing anything special, you shouldn't have to do anything else then filing a bug report.

Of course it could help the developers, if you could point out which FreeBSD version (7.3, 7.4, 8.0, or 8.1) lost the ability to create the /dev/ad3s1 and /dev/ad3s2 devices.
__________________
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
Old 1st March 2011
jb_daefo jb_daefo is offline
Spam Deminer
 
Join Date: May 2008
Posts: 303
Default

Maybe be sure you have geom_mbr.ko, geom_label.ko and geom_bsd.ko loaded, they may be (not to affirm that they actually are...) omitted by default in later versions of freebsd. (Seems to help in a majority of v7 v8 cases at least).
__________________
FreeBSD 13-STABLE
Reply With Quote
Old 2nd March 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Can you post the complete output of the # dmesg command?
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 3rd March 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 45
Default RESOLVED. I think.

I think I've resolved this, but in a roundabout way. Here's how it happened.

The two partitions are now available through Dolphin, and are mounted through /dev/fuse# strings. Currently they are mounted in the /media directory, according to disk label. I'm hoping I can edit fstab to auto-mount them at a location more to my liking. I need to read up on that. This new method of tracking devices caught me unawares.

I only discovered this after a long song & dance with the partition utility. Apparently the disk drive had some other problems that needed to be fixed before FreeBSD would work with it (a few bad sectors and some link errors, I think). I ended up having to rebuild the partitions after all, which is something I wanted to avoid. But, what's done is done, and I have a clean backup (on an external drive), so nothing is lost.

I used sysinstall to rebuild the drive, just to make sure that FreeBSD had a record of what I was doing. I was hoping that it would create /dev files along the way, but it didn't. It made those /dev/fuse files instead. Anyway, the partitions used to be Fat32, but now they are NTFS. Windows-XP doesn't seem to care, and FreeBSD is much happier with the NTFS layout. That struck me as odd, but in the end I guess that doesn't matter.

Once I had the two partitions set up, I made a side trip to Windows-XP to format them. Again, Windows-XP didn't mind the new file system, and the formatting went off without a hitch. It was more concerned with locating files it couldn't find any more. I'll restore the contents of the partitions tonight; that should keep WinXP happy.

Back in FreeBSD, opening the Dolphin file manager provided two new icons for the partitions, which I was able to manually mount. Doing a "df" gave me the device strings; I had never heard of /dev/fuse0 and friends before. Note that before rebuilding the partitions, Dolphin didn't have those two icons, and conventional command-line mounting didn't work. It took a while, but FreeBSD can now use those two important partitions.

At any rate, I'm still hoping to tweak fstab to put these partitions where I want them. But if that doesn't work, I can live with how things are now. Once I do a file dump to restore the data in the new partitions, my system will be just like it was before. But with a more current FreeBSD instillation.

Ah, the things we do to keep our little red daemons happy.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fdisk Question Crotalus FreeBSD Installation and Upgrading 2 10th February 2010 08:10 AM
external drive partition question + fdisk question gosha OpenBSD General 15 15th June 2009 02:00 PM
smb mounting question zerhacke FreeBSD General 5 3rd January 2009 01:47 AM
fdisk -B does not rewrite the mbr kasse NetBSD General 0 25th November 2008 11:07 PM
FreeBSD equivalent of DOS's fdisk /mbr Nobber FreeBSD General 5 3rd June 2008 07:19 AM


All times are GMT. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick