|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
||||
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 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:
I recommend using Windows Disk Management to repartition the drive and reformat it. Quote:
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. |
|
||||
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.
|
|
||||
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 |
|
||||
Quote:
|
|
||||
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. |
|
||||
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. |
|
||||
Quote:
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. |
|
||||
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. |
|
||||
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 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) 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) # 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. |
|
||||
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 |
|
||||
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:
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. |
|
||||
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.
|
|
||||
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. |
|
||||
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. |
|
||||
Quote:
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 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 Code:
newfs_msdos /dev/rsd0i Code:
newfs /dev/rsd0k When trying to mount : Code:
mount -t msdos /dev/sd0i /usr/usbdevices Code:
mount /dev/sd0k /usr/usbdevices 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. |
|
||||
That's been evident all along.
Quote:
Code:
newfs_msdos /dev/rsd0i Quote:
Quote:
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. |
|
||||
That's because i'm not hiding it.
Quote:
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:
Last edited by jggimi; 24th August 2011 at 07:05 PM. |
Tags |
format, hard disk, master boot record, seagate |
Thread Tools | |
Display Modes | |
|
|
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 |