DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

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

Reply
 
Thread Tools Display Modes
Old 16th August 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

I installed sleuth kit but couldn't get the autopsy add-on.I tried under ubuntu the testdisk tool.No partitions found.Since i got tired i decided to format it via windows(the only OS that i was able to format it,it allowed only ntfs formatting and that's what i did).Then attached it to ubuntu to format it to msdos and format was successful.

Before i insert any data to it,i would like to ask if it is a good idea to format it under ubuntu?Would it be better if i just formated it under OBSD?

And generally what is your opinion about trusting this disk?should i consider buying a new one?If yes should i consider some specific brands since i won't it work well with OBSD,Linux and windows?
Reply With Quote
Old 16th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by sepuku View Post
I installed sleuth kit but couldn't get the autopsy add-on.
It is available for download at www.sleuthkit.org -- but now this is entirely academic. Your reformatting has effectively eliminated most data recovery.
Quote:
...Since i got tired i decided to format it via windows(the only OS that i was able to format it,it allowed only ntfs formatting and that's what i did).Then attached it to ubuntu to format it to msdos and format was successful.
Once again, you have violated standards by having a FAT filesystem in an NTFS partition. This is not best practice, since, as I described earlier, and you also discovered, you will never be able to use it with Windows.

Since you have an NTFS partition, you would have to use the Windows Disk Management applet to repartition the drive, and establish a FAT MBR partition instead. (From Windows XP, this is: Control Panel....System and Maintenance....Administrative Tools....Computer Management...Storage...Disk Management.)
Quote:
Before i insert any data to it,i would like to ask if it is a good idea to format it under ubuntu?Would it be better if i just formated it under OBSD?
Neither. Both of these operating systems allow the admin to violate standards, due to a lack of knowledge.

I recommend using Windows Disk Management to repartition the drive and reformat it.
Quote:
And generally what is your opinion about trusting this disk?should i consider buying a new one?If yes should i consider some specific brands since i won't it work well with OBSD,Linux and windows?
We know that there are, or were, some failed sectors. However, your reformat was likely "quick" and did not write over every sector, only laying down the minimum NTFS filesystem metadata for an "empty" 2TB drive, then having the same thing done for a FAT filesystem.

Until you have written and read to every sector successfully, and proven that there are no more "offline uncorrectable" or "pending" sectors reported by SMART, this drive is not to be trusted.

I cannot tell what problems this drive has, other than the bad sectors. I do not understand why dd and fdisk on OpenBSD have failed for you. I suspect a PEBKAC, as you know.

The typical recommendation to "cleanse" a disk of bad sectors is write to every sector, then read from every sector, then check SMART status. A lot of admins use dd for this purpose, something like this:

# dd if=/dev/zero of=/dev/rsd0c bs=1m conv=noerror
# dd if=/dev/rsd0c of=/dev/null bs=1m conv=noerror
# smartctl -a /dev/sd0c

But since dd hasn't been working for you even to read a single sector... there is another tool which can do this more robustly: the badblocks program, which is part of the e2fsprogs package. Your ubuntu system may have it installed already.

Last edited by jggimi; 16th August 2011 at 05:43 PM.
Reply With Quote
Old 16th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I should clarify that the second phase, reading sectors, is used to confirm the writes were good. Writing can be "successful" without actually being readable. This is why I like badblocks, it writes a series of patterns to each sector, and reads them. Multiple chances to clear up a bad block that way, and the patterns test each sector's magnetic storage capabilities.
Reply With Quote
Old 18th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

You may find this recent thread from the misc@ mailing list insightful. It's about forensics of an FFS partition, rather than FAT, but the issues are much the same.

The thread begins here:
http://marc.info/?l=openbsd-misc&m=131361976522256&w=2
Reply With Quote
Old 18th August 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

Quote:
Originally Posted by jggimi View Post
Since you have an NTFS partition, you would have to use the Windows Disk Management applet to repartition the drive, and establish a FAT MBR partition instead. (From Windows XP, this is: Control Panel....System and Maintenance....Administrative Tools....Computer Management...Storage...Disk Management.)
Even that way windows will suggest only NTFS.FAT is not an option.
Reply With Quote
Old 18th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Very odd. I guess once something is NTFS, it won't let you change it. You could always zero out the MBR sector with dd ... no, wait, I guess you can't.

You can always use a command window and the Windows format command.

Start...Run....cmd if you've never used a command line on Windows before. You will get a text based window containing a command line prompt.

Use format /? to get a description of the command and its options and operands. /FS:<filesystem> is the operand of specific interest. FAT32 is the filesystem type you are looking for.

This command should change the MBR partition table while formatting. If it works at all.

Last edited by jggimi; 18th August 2011 at 04:28 PM.
Reply With Quote
Old 18th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Perhaps dd would work for you from Ubuntu, since it doesn't work from OpenBSD. The command would be the same, except for the device node.

# dd if=/dev/zero of=<device node> count=1

That will put zeros in the MBR sector, making the drive appear to be "blank" to Windows.
Reply With Quote
Old 18th August 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

Quote:
Originally Posted by jggimi View Post
Very odd. I guess once something is NTFS, it won't let you change it. You could always zero out the MBR sector with dd ... no, wait, I guess you can't.

You can always use a command window and the Windows format command.

Start...Run....cmd if you've never used a command line on Windows before. You will get a text based window containing a command line prompt.

Use format /? to get a description of the command and its options and operands. /FS:<filesystem> is the operand of specific interest. FAT32 is the filesystem type you are looking for.

This command should change the MBR partition table while formatting. If it works at all.
Well still only for ntfs works.Also i tried a windows program(Aomei Partition Assistant) which also only formats to ntfs.If i try fat32 : Sorry,the current operation has been canceled!:Information Code:102.Description:Certain Bad Sector exists is DBR

I don't think that it's worthy of any more trials.Since i'm not going to use other OS than OBSD on my desktop and ntfs is read-only on OBSD,it's just not practical.Well I got my lesson for backing up,that's SURE.Too bad that it was the 2TB disk.

Last edited by sepuku; 19th August 2011 at 01:28 AM.
Reply With Quote
Old 19th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Again, I would test the drive with badblocks before putting it back in service. At the very least, it will rewrite sector 0, wiping out your MBR. Did you even try zeroing it?

If you require a single filesystem shareable by Windows, Linux, and OpenBSD, you are limited to FAT. If Windows is not involved, EXT2 is another choice.
Reply With Quote
Old 19th August 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

I have not tried badblocks yet and i zeroed the disk on ubuntu:

Code:
sepuku@sepuku-laptop:~$ sudo dd if=/dev/zero of=sdb count=1
[sudo] password for sepuku: 
1+0 records in
1+0 records out
512 bytes (512 B) copied, 7.156e-05 s, 7.2 MB/s
and i checked the disk on my windows xp (installed on virtualbox) and now there's also the choice to format on "exFAT".

Also,at the moment im trying dd if=/dev/zero of=/dev/rsd0c bs=1m conv=noerror on OBSD.
It runs with no errors for about an hour.(hasn't finished yet).
The red light of the disk is on which i think it means that dd is doing it's job...i guess.

Do you happen to know how much time could it take?

edit:i stopped it with control+c:

Code:
$ sudo dd if=/dev/zero of=/dev/rsd0c bs=1m conv=noerror
^C104591+0 records in
104590+0 records out
109670563840 bytes transferred in 4632.680 secs (23673241 bytes/sec)
and dd if=/dev/rsd0c of=/dev/null bs=1m conv=noerror

after hitting again control+c:

Code:
$ sudo dd if=/dev/rsd0c of=/dev/null bs=1m conv=noerror                        
Password:
^C5389+0 records in
5389+0 records out
5650776064 bytes transferred in 175.096 secs (32272301 bytes/sec)
I thinkthat these are good!But now smartctl won't run on openbsd:

# smartctl -a /dev/sd0c
ksh: smartctl: not found


could i miss a packet?I can read normally the smartctl(8) manual.

From the Ubuntu box smartctl gives:

Code:
sepuku@sepuku-laptop:~$ sudo smartctl -a /dev/sdb
[sudo] password for sepuku: 
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     ST2000DL001-9VT156
Serial Number:    5YD0H1YX
Firmware Version: CC96
User Capacity:    2,000,398,934,016 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Fri Aug 19 17:04:16 2011 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status:  (0x82)	Offline data collection activity
					was completed without error.
					Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		 ( 623) seconds.
Offline data collection
capabilities: 			 (0x7b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   1) minutes.
Extended self-test routine
recommended polling time: 	 ( 255) minutes.
Conveyance self-test routine
recommended polling time: 	 (   2) minutes.
SCT capabilities: 	       (0x103b)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   124   100   006    Pre-fail  Always       -       723941472
  3 Spin_Up_Time            0x0003   092   092   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   099   099   020    Old_age   Always       -       1671
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   066   060   030    Pre-fail  Always       -       3898564
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       514
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       139
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   083   000    Old_age   Always       -       472453611630
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   057   038   045    Old_age   Always   In_the_past 43 (0 30 43 43)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       69
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       1871
194 Temperature_Celsius     0x0022   043   062   000    Old_age   Always       -       43 (0 17 0 0)
195 Hardware_ECC_Recovered  0x001a   124   100   000    Old_age   Always       -       723941472
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       209143432479407
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       2313101850
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       737485949

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Aborted by host               90%       504         -
# 2  Short offline       Completed without error       00%       504         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Last edited by sepuku; 19th August 2011 at 02:08 PM.
Reply With Quote
Old 19th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

ExFAT is not desirable; that is a Microsoft proprietary filesystem. See
http://en.wikipedia.org/wiki/ExFAT
Code:
# smartctl -a /dev/sd0c                                                        
ksh: smartctl: not found
It looks like your $PATH is incomplete. By default, the application is in installed in /usr/local/sbin.
Reply With Quote
Old 19th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Do you happen to know how much time could it take?
Let's do the math: 2,000,000,000,000 bytes at 23,673,241 bytes/sec = 84484 seconds = 23.5 hours.
Reply With Quote
Old 19th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

OOoooooh! Sepuku, I just found something I did not know, since I don't deal with FAT outside of USB sticks and phones and cameras.....

On that ExFAT wiki page, highlight mine:
Quote:
Note that the built-in Windows 2000/XP/Vista/7 can mount and support FAT32 volumes larger than 32 GB, but cannot create a FAT32 volume larger than 32 GB.
I mislead you. Windows cannot create a large FAT32, you'll have to use either OpenBSD or Ubuntu.

On OpenBSD:

Step 1: create a new MBR on the drive. For ease of use, I would use fdisk -i sd0 to initialize the MBR sector. This creates a single large OpenBSD MBR partition in partition #3, of type #0xa6, as described in the fdisk(8) manpage. Then I would use the fdisk editor and change the partition type to FAT32, #0x0c with sdisk -e sd0 then the command e 3 to edit partition #3, and change the partition id to 0c.

Step 2: using disklabel(8) create the OpenBSd disklabel and the appropriate BSD partition.. Provide the BSD partition with the same sector range as the MBR partition, as described earlier in this thread.

Step 3: format the OpenBSD partition with newfs_msdos specifying FAT32. If the BSD partition were "a", and you wanted a volume label of "mydisk", you might use something like:

# newfs_msdos -F 32 -L mydisk sd0a

Last edited by jggimi; 19th August 2011 at 05:08 PM.
Reply With Quote
Old 22nd August 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

Unable to read MBR is all i get when i try fdisk -i sd0.I finally managed to format the disk to fat32 under Ubuntu using "Gparted"(but it creates offset 256).But When i try to mount it on OBSD my pc crashes,mouse and keyboard won't respond and i have to shut the pc down using the power button.
Reply With Quote
Old 22nd August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

1) Review your /var/log/messages* files -- this is your kernel message history -- and search for error messages with timestamps that match the time of this most recent crash or hang.

2) Confirm you are able to write to, then read from, every sector of the drive, and that your two tables of known bad blocks have returned to zero. As I stated multiple times in this thread, a bad sector will remain unreadable until it is replaced by a spare sector, which only occurs when a known bad sector is written. You do not need to use OpenBSD for this; you can use Ubuntu, where you seem to have more success. I'll continue to recommend badblocks.

3) An interesting test is the SMART extended offline self-test. It had been run on your drive at least once, because you have "offline uncorrectable" sectors. In this test, the drive electronics reads every sector on the drive. The value of this test are multiple: a) it finds bad sectors that are not in use by your OS, mitigating the risk of future data loss from writing to undiscovered bad sectors; b) it puts bad sectors on a list that are automatically replaced with spares when written; c) it is a test by the electronics on the drive, eliminating bus cables, connectors, or software drivers producing false positives; d) it can be run while using the drive with your OS, though drive performance will be impacted, and the elapsed time for the test will be extended. You can request one with the -t long option of smartctl; you then use smartctl with the -a option to compare results after the test has completed.
Reply With Quote
Old 22nd August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Just a suggestion, Sepuku. Install smartmontools on all your systems, and configure the smartd daemon to run short tests and long tests on a regular schedule. My systems all run the short test -- just an an electronics self-test -- daily, and the long test, reading the media, weekly.

When I get bad sectors, which happens once in a while, I take the drive out of service and run badblocks against either a single section of the drive or the entire drive, depending on symptoms. If the problem drive is part of a RAID array, the server keeps on running, and I merely return the drive to service. If it's not part of a RAID array, such as in a desktop, I schedule downtime, and use my full and incremental backups as required.
Reply With Quote
Old 24th August 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

Quote:
Originally Posted by jggimi View Post
1) Review your /var/log/messages* files -- this is your kernel message history -- and search for error messages with timestamps that match the time of this most recent crash or hang.
Yesterday i had a problem and my pc was stuck on the boot kernel messages(PC stucked and shut it down with the power button) so i reinstalled openbsd so there is no history.I think there could be some solution to fix it without reinstalling but had no patience so i did it the "noob way".

Anyway i was thinking a lot my issue yesterday and i thought something practical(if it works).I decided to create two parttions:

1)msdos ,40gigabytes as an intermediary partition from and to OpenBSD between the other OSes.

2)4.2BSD ,with the rest of the capacity of the drive.


So this is what i did:

Code:
disklabel -E sd0
added i and k partitions which now look like this:

Code:
$ sudo disklabel sd0 
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: 001-9VT156      
duid: ba0c2bddc8cd4a44
flags:
bytes/sector: 4096
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30400
total sectors: 488378646
boundstart: 0
boundend: 488378646
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:        488378646                0  unused                   
  i:         10490382               63   MSDOS                   
  k:        477885552         10490448  4.2BSD   8192 65536    1
then formatted using these commands:

Code:
newfs_msdos /dev/rsd0i
and

Code:
newfs /dev/rsd0k

When trying to mount :

Code:
mount  -t msdos /dev/sd0i /usr/usbdevices
and

Code:
mount /dev/sd0k /usr/usbdevices
Both mount successfully.


Now what i want to ask is:

1)I need to mount both partitions everytime i attach the disk or the one i need everytime?

2)Also how i set in which partition a file will be saved?I mean if i cd to disk i see no directories or anything.It's completely empty.
Reply With Quote
Old 24th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by sepuku View Post
... but had no patience...
That's been evident all along.
Quote:
1)msdos ,40gigabytes as an intermediary partition from and to OpenBSD between the other OSes.
This requires an MBR partition table too. You will need two MBR partitions: one of type 0x0B or 0x0C for your FAT32 partition, another of type 0xA6 for your OpenBSD partition(s). Your "k" partition would map to the same sectors as the A6 MBR partition, if it is the only BSD partition on the drive.
Code:
newfs_msdos /dev/rsd0i
You may not be using FAT32, as you did not format with the -F 32 option.
Quote:
I need to mount both partitions everytime i attach the disk or the one i need everytime?
Only the one(s) you need. You can populate them in your fstab(5) with the "noauto" option, so that the OS will not attempt to mount them during boot.
Quote:
Also how i set in which partition a file will be saved?I mean if i cd to disk i see no directories or anything.It's completely empty.
You mount a partition to a mount point. This is a directory ("folder", in Windows terminology) somewhere in your hierarchy. You create directory structures after mounting with the mkdir(1) command.

Let us pretend you had two directories you wanted to use as mount points. You decide one of them will be /var/shared, the other will be /usr/local/stuff.

After you create the directories, and mounting your two partitions, you can then create directory structures underneath them, and save files there accordingly.

Example:

# mkdir /var/shared /usr/local/stuff
# mount_msdos -l /dev/sd0k /var/shared
# mount /dev/sd0i /usr/local/stuff
# mkdir /usr/local/stuff/things
# cp /root/myfile /usr/local/stuff/things
# cd /usr/local/stuff
# cp things/myfile /var/shared/

The creation of the mount points is only needed once. The mount commands can be simplified, if you put the information into fstab as mentioned above.

# mount /var/shared

Yes, there are graphical file managers and even mount managers that you can use with your X Windows environment so you don't have to learn to use commands in a shell.
Reply With Quote
Old 24th August 2011
sepuku's Avatar
sepuku sepuku is offline
Real Name: Vizard Sepuku
Package Pilot
 
Join Date: Jun 2011
Location: Athens & Chania,Greece
Posts: 143
Default

Quote:
Originally Posted by jggimi View Post
That's been evident all along.
That's because i'm not hiding it.

Quote:
Originally Posted by jggimi View Post
This requires an MBR partition table too. You will need two MBR partitions: one of type 0x0B or 0x0C for your FAT32 partition, another of type 0xA6 for your OpenBSD partition(s). Your "k" partition would map to the same sectors as the A6 MBR partition, if it is the only BSD partition on the drive.
OOoh is see. Well still fdisk -e sd0 is unable to read MBR.(this happens only with this disk;with wd0 works fine.Also when i try to save the changes i make it says "no label changes" although in 'disklabel sd0' i see the changes.

I think the disk is useful only for recycling right now.
Reply With Quote
Old 24th August 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by sepuku View Post
I think the disk is useful only for recycling right now.
I don't.

I think there is some sort of issue still remaining, that may be repairable. All it will take is time to make that determination, with very little actual effort.

Assumptions: Ubuntu can communicate with the disk, OpenBSD can't (right now).

If it were me with these problems, this is what I would do:
  1. Run badblocks with the -w option to test every sector, as I've recommended over and over. I'd do it that from Ubuntu, since OpenBSD is having trouble. As far as I know, you have yet to verify drive usability. (This will take time -- perhaps more than a week. But the problem has already gone on that long, and 2TB drives are costly.)
  2. Run smartctl with the -a option from Ubuntu, and confirm that all known bad blocks are now converted to spares. (If the drive converts so many to spares that it runs out of spare sectors, it will still have bad blocks after step 1. Then you can dispose of it, knowing that it is no longer to be trusted.)


  3. Create an MBR sector and an MBR partition for a portable filesystem between my various systems. From Ubuntu. I would use either FAT32, Ext2, or UFS, depending on my particular needs. (I would also consider the applicability of network attached storage solutions, eliminating the need for filesystem portability, and select NFS, AFS, or SMB, if a networked solution was optimal.)
  4. At this point, and only at this point, I would then move the drive over to OpenBSD, and once more conduct a set of diagnostic tests, confirming I can read and write successfully to the drive. My tests would eliminate as many variables as possible, and if I were able to reproduce your odd errors without kernel messages, I would include some diagnostic tools we have not discussed in this thread, such as systrace(1) and ktrace(1) to determine what might be a root cause. I might begin with -current, rather than -release, as that is an easy test to see if the problem is software, and if it has already been fixed by the Project. If it is an unresolved software problem, -current makes it easier for a fix to be developed and committed.
  5. Once my OpenBSD problem has been resolved, then I would create an A6 MBR partition, create a BSD disklabel, and add partitions as needed for use with FFS filesystems. But only after the problems were resolved.

Last edited by jggimi; 24th August 2011 at 07:05 PM.
Reply With Quote
Reply

Tags
format, hard disk, master boot record, seagate

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
Hard disk reliability ephemera General Hardware 32 20th April 2010 10:17 AM
Hard disk utilization Greg_Morgan General software and network 3 16th October 2009 12:13 PM
Formatting Hard Disk Drive to UFS in OS X 10.5 Turquoise88 Other BSD and UNIX/UNIX-like 1 7th March 2009 09:57 PM
Hard disk bottle neck deathsoul FreeBSD General 1 28th September 2008 10:44 AM
Copy VCD film to hard disk mfaridi FreeBSD General 4 5th June 2008 01:57 PM


All times are GMT. The time now is 11:10 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