Quick Format NTFS from FOG


  • Developer

    I have been experiencing some issues with my noobishness, I began trying to image old hardware without checking the disk specifications and the image that I was trying to place on the drive was larger than the dis capacity. This lead to demise of the drives partition tables.

    I had been using a windows xp disk to boot into the windows set up to quick format the drives back to an ntfs format so that I could image them. I got to thinking and I wanted to put in a tool that would help to do this with ease, but it turns out we already have a tool that can be used!

    If you are not familiar with booting into a Debug mode while imaging, this will also benefit you.

    [CENTER][B]REGISTER HOST TO FOG AND BOOT INTO DEBUG[/B][/CENTER]
    First start by registering the host to the FOG server if you have not done so already.
    Assign an image to the host as well.
    After the host is registered, use the web gui to find the newly registered host, I will call him Test.
    Select “test” from the list of hosts.
    On the left hand side of the page, click on “Basic Task” and select Advanced in the center.
    Here you can see the debug, debug deploy, etc. You can choose one of the Debug options. I have used the Debug, and Debug Deploy, I have not tested further, but they use the same system, as long as it is a debug mode, the commands should be supported.
    Reboot your host and let it boot to the debug menu.

    [CENTER][B]REMOVING PARTITIONS[/B][/CENTER]
    From the debug menu issue the following command
    [code]fdisk -l[/code]
    Your output will look similar to this
    [code]
    Disk /dev/sda: 82.3 GB, 82348277760 bytes
    255 heads, 63 sectors/track, 10011 cylinders
    units = cylinders of 16065 * 512 = 8225280 bytes
    [/code]
    Note the /dev/sda after Disk, this is the hard drive we wish to work with, if you have multiple drives, please be sure to select the correct one!
    Issue the following command where /dev/sda is the name of your disk
    [code]fdisk /dev/sda[/code]
    [B]output:[/B]
    [code]
    The number of cylinders for this disk is set to 9733.
    There is nothing wrong with that, but this is larger than 1024,
    and could in certain setups cause problems with:

    1. software that runs at boot time (e.g., old versions of LILO)
    2. booting and partitioning software from other OSs
      (e.g., DOS FDISK, OS/2 FDISK)
      Command (m for help):[/code]
      To list partitions type [code]p[/code]
      [B]Output[/B] will be similar to this:
      [code]Disk /dev/sda: 82.3 GB, 82348277760 bytes
      255 heads, 63 sectors/track, 10011 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Device Boot Start End Blocks Id System
      /dev/sda1 * 1 13 102400 7 HPFS/NTFS
      /dev/sda2 13 7129 57157632 7 HPFS/NTFS[/code]

    I will delete both of these partitions and start fresh.
    [CENTER][B]NOTE IF YOU HAVE ONLY ONE PARTITION AND YOU TYPE d IT WILL DELETE YOUR ONLY PARTITION!!! BE SURE YOU WANT TO DELETE THE PARTITION BEFORE ISSUING THE d COMMAND![/B][/CENTER]
    Issue the following command
    [code]d[/code] for delete, the console then wants to know which partition to delete, use the number at the end of the /dev/sda to determine the partition number to be removed. In this case it will 2.
    [CENTER][B]IF YOU DELETE THE LAST PARTITION ON THE DRIVE YOU NEED TO CREATE A PARTITION TO FORMAT![/B][/CENTER]
    Issue the number of the partition to be deleted
    [code]2[/code]
    Verify that the partition has been deleted by issuing the following command
    [code]p[/code]
    To save and write changes:
    [code]w[/code]
    fdisk will save and exit.

    [CENTER][B]TO FORMAT THE PARTITON[/B][/CENTER]
    Type the following command to list your disk and partitions.
    [code]fdisk -l[/code]
    My disk is /dev/sda, my partition is /dev/sda1.
    Now format the drive with the following command where /dev/sda1 is your disk and partition number
    [code]mkntfs -Q /dev/sa1[/code]
    This command tells the drive to be formatted in a NTFS Format with a Quick format. You can use mkntfs to display the options and help commands.

    [CENTER][B]IF YOU DELETED YOUR PARTITIONS AND YOU WANT TO ADD THEM BACK AND YOU ARE TOO LAZY TO SEARCH[/B][/CENTER]
    [LEFT]I will assume you are still using the fdisk command[/LEFT]
    [LEFT]Display contents:[/LEFT]
    [LEFT][code]fdisk -l[code][/LEFT]
    [LEFT]Select Disk:[/LEFT]
    [LEFT][code]fdisk /dev/sda[/code][/LEFT]
    [LEFT]Create New Partition:[/LEFT]
    [LEFT][code]n[/code][/LEFT]
    [LEFT]Select a Primary partition:[/LEFT]
    [LEFT][code]p[/code][/LEFT]
    [LEFT]Set the partition number:[/LEFT]
    [LEFT][code]just press enter and accept default, you may supply a number if you wish[/code][/LEFT]
    [LEFT]Last cylinder:[/LEFT]
    [LEFT][code]10011[/code][/LEFT]
    [LEFT]Print out partition tables:[/LEFT]
    [LEFT][code]p[/code][/LEFT]
    [LEFT]Write changes to disk:[/LEFT]
    [LEFT][code]w[/code][/LEFT]
    [LEFT] [/LEFT]
    [LEFT]Now supply your mkntfs command.[/LEFT]
    [LEFT] [/LEFT]
    [LEFT]Hope this helps, good luck![/LEFT]


Log in to reply
 

357
Online

39.3k
Users

11.0k
Topics

104.4k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.