How to partition hard drive for Squid



  • Before everybody starts sending me RTF's, I would appreciate it that you guys read this and helped me out.

    I'm having a very, very hard time partitioning and formatting this 60GB IDE hard drive for my squid cache. It just wont work.

    I'm following this guide: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-adding.html

    First, it says  dd if=/dev/zero of=/dev/da1 bs=1k count=1 And that came back with an error.

    After searching the web for a long time, I've found this: http://nixforums.org/about108698.html

    A guy there said that you have to type this in first:
    sysctl kern.geom.debugflags=0x10

    So, I did that and then after doing step one, I went to step two.

    I got this:

    fdisk -BI /dev/ad1

    ******* Working on device /dev/ad1 *******
    fdisk: Class not found

    Oh well, step three:

    bsdlabel -B -w ad1s1 auto

    bsdlabel: write /dev/ad1s1: Input/output error

    Ok, that does not work either. Step four:

    bsdlabel -e ad1s1 auto

    usage: bsdlabel disk
    (to read label)
    bsdlabel -w [-n] [-m machine] disk [type]
    (to write label with existing boot program)
    bsdlabel -e [-n] [-m machine] disk
    (to edit label)
    bsdlabel -R [-n] [-m machine] disk protofile
    (to restore label with existing boot program)
    bsdlabel -B [-b boot] [-m machine] disk
    (to install boot program with existing on-disk label)
    bsdlabel -w -B [-n] [-b boot] [-m machine] disk [type]
    (to write label and install boot program)
    bsdlabel -R -B [-n] [-b boot] [-m machine] disk protofile
    (to restore label and install boot program)
    Step 5:

    mkdir -p /1

    That was easy. Step 6:

    newfs /dev/ad1s1a

    /dev/ad1s1a: 57277.8MB (117304912 sectors) block size 16384, fragment size 2048
    using 312 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
    super-block backups (for fsck -b #) at:
    newfs: wtfs: 65536 bytes at sector 160: Input/output error

    You get the point. Its not working. I've spent hours and hours studying it. I've searched the forums. I've asked in several freeBSD/pfsense IRC chat rooms… I've tried to see if the drives are mounted or not. I'm really fried.

    Any help would be appreciated.



  • A couple of comments: first you say "it came back with an error" (step 1).  Be nice if you told us what that was.  More bogusly: in general if step N didn't work, it's almost certainly useless to do any steps after that.



  • Thanks for your reply.

    Oh, it just said operation was not permitted and so I had to give it a command to temporarily allow the "operation to be permitted."



  • looking again, i note you were doing the dd command to /dev/da1.  shouldn't it be /dev/ad1?



  • @danswartz:

    looking again, i note you were doing the dd command to /dev/da1.  shouldn't it be /dev/ad1?

    Yes, you're right. I posted the wrong thing here. the command that I actually gave the computer, was on ad1. the da1 was just a quick copy and paste from freeBSD's site.



  • and that drive was not being used for anything? and you were logged in as root?



  • Um, logged in as admin. I tried it as root in a SSH, and same thing happened. No, this drive is not mounted, it ought to just work. I think I'm going to try the liveCD and see if it changes anything.



  • generally you will get a permissions thing like that if something in freebsd is using the drive.



  • Well, I think I am just going to do a reinstall. I've done so much to the OS with trying to get wireless to work, then updating, then trying to get this sata controller to work, then trying to partition the drive, etc. etc. Maybe it will work better if I start from fresh.



  • that is not a bad idea.  sometimes it just seems like it is necessary.


Log in to reply