Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Technology

Linux for HD Repair and Formatting? 61

pair-a-noyd asks: "I have a small PC repair company and am frequently encountering various hard disk drive problems with Windows systems. I often resort to booting up Mandrake to reformat the hard drives because it supports many different formats. However, it's sort of cumbersome to go through the Mandrake setup menus to get there then abort out once the disk is formated. Is there any Linux distro that boots from CD and is designed with ONLY hard disk drive utilities in mind (surface scans, flagging bad sectors, and so on)? It would be very nice if you could boot a Linux CD and go in and hammer a troublesome hard drive into submission and then reformat it with the FS of your choice. Going throught the Mandrake system is cumbersome and using the Windows installation routine is not very friendly either."
This discussion has been archived. No new comments can be posted.

Linux for HD Repair and Formatting?

Comments Filter:
  • SuperRescue (Score:5, Insightful)

    by 0x0d0a ( 568518 ) on Monday March 03, 2003 @05:25PM (#5426830) Journal
    SuperRescue [kernel.org], a Red Hat-based boot-from-cd distro, sounds like what you want. I use it for troubleshooting and whatnot all the time. *Anyone* who considers themselves a techie should have one of these CDs burned somewhere, as it's a tremendously useful tool.
    • I like SuperRescue but I don't think Redhat 8.0 likes it very much. It would no let me reinstall GRUB after WinXP had blown it away (something about incompatible libraries)
  • Why not use Knoppix? (Score:5, Informative)

    by MrHanky ( 141717 ) on Monday March 03, 2003 @05:25PM (#5426832) Homepage Journal
    Yes, why not? You could probably make your own slimmed-down disc based on it, and it's got all you need. It doesn't get any easier.

    Get it here [knopper.net]
    • Knoppix has saved my skin on my windows boxen on many occassions.

      i've also used Openoffice to "repair" broken office files. Take broken MS Office file, open in Openoffice, Save As whatever MS format, then reopen in MS Office. It even slims down powerpoint files. Pretty useful at the office.
  • The Debian setup allows you to do things in another order. I'm not sure it contains too many sophisticated harddisk tools.
  • by PD ( 9577 )
    Use knoppix. If whatever you want isn't on the CD, you can easily customize it and burn your custom ISO image to a new CD.

    • indeed, knoppix would be a nice distro to use! am working on an Expert-iso especially for these purposes (and without the cruft ;) but knoppix is a nice tool-of-all-trades
  • by hardpress ( 230218 ) on Monday March 03, 2003 @05:30PM (#5426877) Homepage Journal
    Boot from Install CD 1 and, at the text prompt, type 'linux rescue'.

    Linux will boot from the CD and present you with a command line interface and and a sub-set of the normal command line tools.

    Only the essentials for system administration are there, but everything you need (fdisk etc.) should be included.

    Other distro's probably support this too. I've only done it with Red Hat.

    If your hardware doesn't support booting from CD, then you can get the same result by booting from an install floppy (once you've done a bit of network configuration).
    • Yes, RH/"linux rescue" is my favorite.

      The RH 7.x (1<x<3) are really useful to have at hand. They even detect if you have pcmcia card, and configure them ! I did not try with 8.0, though. (When it come to RH, x.0 means alpha, and y.1 means beta anyway)

      A few hints, from experience:

      • Keep all three version, at least the boot CD because some of them might not work on every hardware combination. Of course, try 7.3 beforehand.
      • As well, if your disk have "disk manager" bios-replacing "utilities" installed on them, having the corresponding floppy to boot into your CD is a good idea. The same way, a win98 recovery floppy will let you boot you RH installation by selecting "with cd-rom support", then launch "D:\dosutils\autoboot linux rescue"
      • If you were disturbed, and the machine just booted the regular install, just go through the keyboard/language combination, and leave it there. Now just use ctrl-alt-F2 and F3 to switch to a shell that basically gives you the same functionnality as "linux rescue"
      • Even in linux rescue, you can use ctrl-alt-F1 and F2 to switch between two shells. I leave to the curious minds to guess what the other virtual consoles are displaying...

      For example, when our stoopide corporate M$ install barf on a weird partition table -> "linux rescue" -> "dd if=/dev/zero of=/dev/hda"->wait 10 s before ctrl-c, and voila. Linux help M$.

  • Gentoo LiveCD (Score:2, Informative)

    by SuperBeaker ( 604944 )
    I use my Gentoo Linux Install CD [gentoo.org] for this kind of work.
  • EBCD and Bart's Way (Score:5, Informative)

    by Hadean ( 32319 ) <hadean.dragon+sl ... g m a i l . c om> on Monday March 03, 2003 @05:36PM (#5426953)
    There's several methods to do what you want. My personal favourite is EBCD [i.com.ua]. With a little changing here and there, it's become the most powerful boot CD I can possibly imagine! Every util for Windows and Linux (FAT16, 32, NTFS, etc.) is there... I'm not related to them whatsoever, but after getting their Pro version and manipulating it to my tastes (switching some programs to my own copies), I don't think I'll have to worry about boot disks for a long while.

    Also, there's "Bart's Way" which is heavy on modules. Check out his website: http://www.nu2.nu/bootcd/ [nu2.nu]
  • by davesamson ( 614779 ) on Monday March 03, 2003 @05:45PM (#5427059)
    I highly recommend using LNX-BBC or LinuxCare for any type of rescue/administrative on the fly work.

    LNX-BBC [lnx-bbc.org] is small enough to fit on one of those business card cds and is aimed towards people who know what they are doing; (read: no man pages).

    Linuxcare [planetmirror.com] is another great linux toolkit for administrative work.

    Check out this page [planetmirror.com] for a list of other linux bootable toolkits. Cheers!
  • beos! (Score:3, Funny)

    by Anonymous Coward on Monday March 03, 2003 @05:49PM (#5427103)
    Actually, BeOS would be good.


    DiskProbe, the block editor, lets you edit files, entire disks, or just the partition.


    DriveSetup, the drive setup thingy, lets you do all the partitioning (apple and ibm styles), formatting, low-level formatting, block checking, that sort of stuff.


    You could make a boot CD that let you run those programs (and Terminal if you needed to muck around in bash), or use the install CD (and hit alt-T to bring up terminal iirc)

  • by dentar ( 6540 )
    Why "Hammer a troublesome hard drive into submission" in the first place? If the hard disk is giving a bad spot or any sort of read problems, THROW IT THE FRELL OUT! The way drives are designed to mask the bad spots these days, if a bad spot shows up, then it's already frelled beyond belief.

    Going after bad spots is a hold-over from the bad old days of MFM and RLL controllers. I remember flagging up to 20 or 30 bad spots per drive when putting them in. I remember feeling fortunate to have bought a hard drive with maybe one or two. Once I had a drive with a totally empty flag table. Boy, I felt special!

    Now, if it's a filesystem problem with Win-duhs (e.g. user turned off the PC whilst writing) then that's ok... reformat it.

  • I've had to do this many many times.

    Using mandrake no-less! I've run into many disks that have gone bad and may need to be re-partitioned or reformatted, but the tools that come with windows are pure unadulerated $hit!

    "Cannot remove Extended Dos partition while logical drives exist" ok fine remove logical drives "cannot removed logical drives while extended partition exists" hmmm add logical drive "cannot add logical drive without primary dos partition" fine add primary dos partition , then removed logical drive...etc etc...no go...boot mandrake select one huge windows partition format it, then abort install and viola!

    perhaps someone more familiar with coding can hack the mandrake installer so that i'ts sole function is to blow away hard disks?

    • Yeah, the F in M$'s FDISK stands for something else.

      It's even more fun if the drive is corrupt. Some version required you to type in the label of the partition if you wanted to delete it. If it had nonprinting characters (which happens) you can't delete it. It does a "Verifying Drive Integrity" at every step, like before and after it asks you (y/n) Oh my god I've got to stop talking about this and get over it!

      Even if you're only going to run 'doze, get Linux just for the sake of checking / prepping the disk. I'm not quite sure out of Solaris' fdisk and M$ FDISK which one sucks the most. Both are quite infuriating.

      Blow away harddisks?

      dd if=/dev/zero of=/dev/hda bs=512 count=2

      If that doesn't work (I'm haven't used it in a while) and there's definitely nothing you want on the disk, increase the count number, you won't do any harm except data erasure. Someone else here suggested doing it without a count, and hitting ctrl-C after ten seconds. I wouldn't do it this way if you only wanted to clear the partition table and boot record.

      • I too have had my share of FDISK nightmares, but found a little free utility called "Hardcure". It nukes the whole harddrive, and then Fdisk will rebuild the partition after a boot. Here is a link to it. http://www.drivermuseum.com/files/utils/hd_u.html
    • perhaps someone more familiar with coding can hack the mandrake installer so that i'ts sole function is to blow away hard disks?

      dd is a bit copier and is found on most Unix-stype systems including boot floppies. This includes things such as Tomsrtbt (linux) and many of the bootable *BSD diskettes. Example;

      1. dd if=/dev/null of=/dev/hda

      The line above reads: take the input file (if) from the empty device (/dev/null) and copy it into the output file (of) of the first ide drive on the first ide channel (/dev/hda) ignorning any partitions. Since there is no limit, the command will execute till the whole drive is wiped.

      To speed this up, you can limit the wipe to the boot sector only using the count= and bs= options.

      For example, to wipe only the first 512 bytes (the boot sector including the partition table), add 'count=1 bs=512';

      1. dd if=/dev/null of=/dev/hda count=1 bs=512

      To save the boot sector, you could do this;

      1. dd if=/dev/hda of=hda.bootsector count=1 bs=512

      After wiping the disk or the boot sector, you can run any disk partitioning (Ex: fdisk) or installation program on it you want.

  • by sofar ( 317980 ) on Monday March 03, 2003 @06:33PM (#5427592) Homepage
    quite some nice tools, it's an install ISO for our source distro, but it also supports RAID in the kernel, ext3, jfs, xfs, reiserfs and a whole lot more fs tools. kernel is always latest and up to date. give it a try!

    http://www.lunar-linux.org/

  • Slackware 8.1 CD (Score:3, Informative)

    by Phaid ( 938 ) on Monday March 03, 2003 @06:43PM (#5427724) Homepage
    I find myself doing the very same thing pretty frequently. I use a Slackware 8.1 Install CD for this. The Slackware CD initially boots to a prompt where you can pass in kernel parameters (root= for example comes in handy sometimes). The Linux kernel then boots. If you don't specify a root filesystem, it boots to a busybox command prompt where you can run fdisk and where all of the usual linux disk utilities are present. The long and short of it is, you put in the CD, hit enter once, and then you get a # prompt where you can fix whatever needs fixing.
  • What about slackware? I don't know if it has msdos formatting utils, but it does have some nice cli proggies.
    • What about slackware? I don't know if it has msdos formatting utils, but it does have some nice cli proggies.

      Phew, I thought for a minute you said MSDOS had some nice CLI proggies...

      I'm pretty sure Slackware's root diskette doesn't have mkfs.msdos because it isn't needed, if you're installing in UMSDOS the presumably the DOS filesystem already exists. You could delete mkfs.ext2 to make room for mkfs.msdos and simply copy that on there from a normal system.

      Keep the boot / root disks handy. You'll use them (if not to install Linux, prep the system for something else) about 20 mins after you've finished installing 'doze.

      -1, Flamebait.

    • Slackware is my favourite tool for this too. I always carry a boot and root disk with me, just in case I have problems booting off the CDROM.

      The system you get includes lots of PCI and /proc stuff, just the ticket for exploring alien hardware before deciding what to load on it.

      ...laura

  • Use the Right Tool (Score:1, Informative)

    by Anonymous Coward
    Use the right tool for the job. Buy "Partition Magic" make a set of floppies and don't look back.... slide and resize those partitions all you want. Format one partition FAT32, one FAT, one HPFS, another EXT2 and yet another NTFS and even convert between most of the formats (yes, you really can go back to FAT32 from NTFS, regardless of what Microsoft says) You just gotta pony up and pay the couple bucks for the right software
  • by dsb3 ( 129585 )
    I have used Trinux [sourceforge.net] a fair amount, though it appears to be showing signs of semi-abandonment (for example, I'm sure they used to have the trinux.(some tld) domain as an alias for the SF pages).

    Disk rescues are easy. Also used it to build a temporary web-server (with "down for maintenance" splash pages) that entirely fit on a floppy that we used while moving servers from one location to the other. Unplug server, leave a no-name x86 box behind with a floppy to hold the IP address until the real webserver was settled in at it's new home.

  • Use Partition Magic. It's not that expensive, and works great -- you can run it from a boot floppy or CD.
  • TomsRTBT (Score:3, Informative)

    by Smidge204 ( 605297 ) on Monday March 03, 2003 @07:38PM (#5428257) Journal
    I keep a copy of TomsRTBT [toms.net] in my bag, just in case. Not being a 'hardcore Linux user' I rarely need anything else to clean up a friend's machine. Hey, it fits on a floppy and runs on anything with more than 4MB RAM, and does everything you seem to need (and then some).

    =Smidge=
  • Most manufacturers of drives have free software to test the drive. It can:
    test the drive and indicate when it is defect
    remap bad sectors so the drive seems to have no bad sectors
    write all the sectors of the drive with zero's
    tell you the SMART status
    for example:
    http://www.maxtor.com/en/support/downloa ds/powerma x.htm
    IBM has DFT, (drive fitness test)
    I am sorry to say this software uses windows to make a bootable dos disk.
    • I prefer to use free software tools as they are more configurable and are designed to be integreated within your operating system in the most configurable ways. The smartmontools [sourceforge.net] gives your SCSI and IDE drive a complete report [dattaway.org] of performance and errors logged since it was new. This utility may be run as a daemon in your crontab to mail out errors or change the terror alert color to orange when things go south. Not having a report card for your drives is bad karma.

      gentoo: "emerge smartmontools"
  • The Free / expert / wait and hope option:-

    - PARTED on a bootable distro.
    QT-Parted gives you a graphical interface. Hopefully someone will add it to Knoppix for you.

    The Mandrake bodge improvment option:-

    - No need to go through the mandrake menus - just click on the left side to skip straight to the partitioning section :) !!

    The not-free option:-

    - beg/borrow/steal Partition Magic. Although it installs to Windows that installed program generates a boot floppy that can be used elsewhere.

    fdisk / cfdisk option:-

    - use a boot disk / cdrom to boot and use cfdisk or fdisk

    Slashdot message me if you like :)
  • A friend of mine took a small hard drive and installed a copy of Debian (methinks) on it. He then booted systems that needed work from the HD with the original slaved or on a separate controller. He could then use the appropriate FS tools/drivers to correct issues with the hard drive/filesystems, as well as test the stability of the processor and memory (gmake -j10 on a kernel source should do it.) You'll get various segfaults/panics for memory issues and processor issues.. can't remember exactly which segfaults equate to which errors, but it's a generalized test. This method also allows you to add new tools to the test image as they come out, rather than having to burn a new CD. I know burning a CD isn't a big deal, but when you want to add something new every week, it can become a pain.
    This method can also be used to test other hardware in the system, although we never actually had to do so. Most problems were limited to processor/memory/HD.
    This was at a PC rapair shop, BTW. The customers were always floored when they found out that there was this "gnu/linux thingie" that could actually do useful stuff. :)
  • Two Distros: (Score:2, Informative)

    by sICE ( 92132 )
    Linux Care Bootable ToolBox [linuxcare.com], Knoppix [knopper.net], and a dozen [toms.net] of small diskettes distros... [netfirms.com]
  • I made a tiny hack util to recover MS office files and RTFs from partial/full disk images I call recover-word, after seeing a lot of damaged floppies/zip disks. I might even make it more efficent one day. However, I did just add a hack to make it automate stripping partial images from a damaged drive, albeit it's not very smart. =)

    recover-word [icculus.org]

    If you try it please send in comments and suggestions - I'm pondering making it usable for lay data recovery persons. I'm pondering adding my unreleased hacks for various other formats like JPEG or just making it use a RC file with a header dictionary and a simple lisp syantax for reading it. Then agian I worked on this maybe in 3 sit downs since I hated doing the recovery by hand over and over. =)

  • tomsrtbt (Score:3, Insightful)

    by Sam Lowry ( 254040 ) on Tuesday March 04, 2003 @04:20AM (#5431253)
    Don't know about the others, but I always keep a diskette of tomsrtbt in my pocket
  • using a sledgehammer to kill a cockroach. There are lots of utilities out there that will do this that will boot off of CD or better yet floppy, without the overhead of a full distro. Try using partition magic from powerquest or some other such thing, you'll save a ton of time.

  • I've used both Knoppix, as said above, and it's a full-featured distro with KDE3 and the works, but I've also recently stumbled upon LNX-BBC [lnx-bbc.org], a distro that works off of a business card CD. Pretty handy for keeping in your pocket or wallet because it's so small. It's not so much GUI-based, but if you're comfortable with the command line (and for what you're doing, you most likely are), it's a wonderful tool. And, it's being updated literally every night. I'd give it a try. There's a huge list of CD-based distros here: http://lwn.net/Distributions/index.php3#cd
  • I have another CD setup here:

    http://www.phenix.bnl.gov/~purschke/RescueCD/

    The main feature is that it allows you to make your own customized CD for whatever purpose. I had a lot of positive feedback.

    You can make it so that it boots and performs stuff automatically.
  • gdisk [symantec.com] isn't Linux-based, but it deserves mention anyway for some of the fdisk limitations it gets around:

    GDisk provides some capabilities that FDisk does not -- such as on-the-fly formatting -- and provides a safer alternative in situations in which known problems with FDisk can cause data loss and hardware damage.

    • Performance: GDisk is command-line driven and much quicker than FDisk. It allows you to define standard configurations in a batch file and apply them to multiple computers.
    • Disk space: GDisk uses disk space better. It is more aggressive in finding free space on the disk for new partitions. In virtually every case it will find space that is ignored by FDisk (this space can vary between 0.5 MB and 16 MB). GDisk reduces slack space (disk wastage). GDisk is more aggressive than the FORMAT utility provided with Windows 95 in attempting to keep cluster sizes small. For some partition sizes, GDisk is able to format partitions with cluster sizes that are half the size that FORMAT would select, resulting in an effective 10-35% increase in drive capacity.
    • Partition management: GDisk allows you to hide partitions, so you can have more than one Primary DOS partition with different versions of DOS or Windows in each partition. Normally, it is not possible to have more than one DOS or Windows installation on the same computer. The ability to hide partitions allows the computer to boot into any selected bootable partition, ignoring other installations of the same operating system in other partitions.
    • Avoid known FDisk problems: The FDisk supplied with Windows 95 has a problem that can create overlapping partitions that will almost certainly lead to corruption of existing partitions. The same problem can also result in partitions that extend past the end of the disk, which can cause permanent damage to the drive when the partition is formatted. This is the one situation in which GDisk does not imitate the exact behavior of FDisk, even with the compatibility switch turned on. The FDisk supplied with Windows 95 has a problem in which it is not possible to delete newly created partitions if the provisionally assigned drive letter to the new drive matches a drive letter currently assigned to a CD-ROM device. GDisk allows the partitions to be deleted even if the new drive letter is currently assigned.
    • Diagnosis: GDisk is useful as a diagnostic tool. It performs extensive integrity verification checks on the partition tables before performing any operations on the drive. GDisk can display the partition information in a raw cylinder/head/sector format. This may be of use to technicians investigating problems with a computer's partition table.
    • DoD specifications: GDisk.exe conforms to most current US Department of Defense (DoD) specifications.


    The switches and batches [symantec.com] are awesome:

    • Display partition information (/STATUS)
    • Create a partition (/CRE)
    • Delete a partition (/DEL)
    • Activate or deactivate a partition (/ACT and /-ACT)
    • Hide or unhide a partition (/HIDE and /-HIDE)
    • Reinitialize the master boot record (/MBR)
    • Wipe the disk surface (/DISKWIPE)


    The batch mode switch, /BATCH, allows GDisk to perform multiple operations with a single command. The operations can be specified interactively at a DOS command-line, or they can be supplied in advance in a text file.
  • A quick MS kludge [microsoft.com] that deserves mention (and of course has many limitations) is booting Windows boxen to a WINNT.sif [winnetmag.com] file (aka an "answer file").

    Pop a floppy in the drive. Open up notepad, and put in something like this [stanford.edu]. Save your file as "winnt.sif" (w/the quotes...otherwise it will name it winnt.sif.txt), and reboot your computer with both the install *and* bootdisk in the drives. The cd (boots first in BIOS, of course) installs according to the WINNT.SIF instructions on the floppy.

Elliptic paraboloids for sale.

Working...