partitioning interview questions

Top partitioning frequently asked interview questions

Why can't I delete all partitions on a flash drive in Windows 7?

Recently I purchased an ADATA C802 8GB flash drive. Since the drive was new I decided to run some of the HD Tune Pro (v4.50) performance tests on it, mostly just for the heck of it.

To avoid accidentally destroying data HD Tune refuses to write to a drive unless there are no partitions on the drive. If you do attempt to write to a drive with partitions, it posts the message "Writing is disabled. To enable writing please remove all partitions."

As you would expect, the ADATA came formatted with a single primary FAT32 partition in the Master Boot Record. But a number of unexpected things happened when I attempted to delete that partition.

  1. The first thing I tried was to use the Windows 7 (64-bit) Disk Management tool (diskmgmt.msc) to delete the partition. It would not let me. The context menu choice to delete that volume was not available.

  2. Next I opened up a command prompt window with Admin authority and ran diskpart. Diskpart deleted the volume for me. However, when I attempted to run an HD Tune write test on the drive I still got the "Writing is disabled" message. Huh???

  3. So I fired up a utility I happen to own which allows viewing drives at the sector level and verified that the partition table in the Master Boot Record was empty. No partitions. Yet HD Tune still thought there were partitions on the drive?

So why was I still getting the "Writing is disabled" message from HD Tune Pro? And why wouldn't the Windows 7 Disk Management tool let me change the partitions on this drive.

After doing the above, I plugged the ADATA into my MacBook. I was then able to format it as either a GPT or MBR partitioned drive with no problems. I am not looking for suggestions on how to format this drive. I can do that.

What I do not understand and was hoping I might get insight into is why this drive behaves so strangely under Windows 7? And BTW, what's up with HD Tune Pro?

BTW, if I plug the drive I formatted on my MacBook back into my Windows 7 64-bit system I still run into road blocks with the Disk Management tool. For example, I cannot delete all the GPT partitions on the ADATA so I can convert it into an MBR drive. I followed Microsoft's instructions, the instructions just do not work with this ADATA flash drive.

Anyone know what's up with this? It makes no sense to me. Has something changed in Windows 7 (Vista)??

Source: (StackOverflow)

Easiest way to move my Windows installation to an SSD?

I've taken the plunge and bought an SSD and want to move my existing Windows installation over. The current hard disk is 500Gb, but I've trimmed the contents down to about ~40Gb. I'm transferring it across to a 100Gb SSD and looking for the easiest way just to copy everything across and set the SSD up as a boot device.

I've looked at a few tools like Macrium Reflect, but they don't seem able to restore to a smaller drive. Do I need to go for something like PING to do this? I'm trying to avoid scary Linux-based boot utilities if possible, does anyone know of an easier way?

Source: (StackOverflow)

How to move a partition to the end in gparted?

I can't find a way to move the partition /dev/sdb2 to the end, where 12GB are free.

enter image description here

I can resize (expand) the partition, but not create (insert) any free space in front of it.

How to do the trick?

(There are 2 small black arrows on the top of the popup window in the screenshot at the side of the blue box that represents the 400 GB sdb2 - I can only move the right arrow to the right, which extends the size, but I cannot move the left arrow. When I enter something in the free space preceding box it is always reset to zero by the programm immediateley)

I hope I explained this well enough, please feel free to ask for details.

This is serious for me as I am expanding a live image.

Maybe there is another solution with linux commandline tools ?

Source: (StackOverflow)

VirtualBox: using physical partition as virtual drive

Background: I am using VirtualBox installed on Windows 7. From within VirtualBox I am using Xubuntu as a virtual OS. The reason I chose this approach is so that I don't have to keep turning off Windows and rebooting from Xubuntu every time I needed to switch OSes. And VirtualBox's seamless mode is pretty amazing to allow me see Xubuntu and Windows 7 all in one screen.

Issue: Now I am thinking of a way to have Xubuntu more integrated into my system. By this I mean I want to have a physical partition for Xubuntu. But I want to still have the feeling of the seamless mode.

Question: So finally, my question is: is it possible to load a partition in VirtualBox as a virtual OS?

Case examples: Ideal scenario would be: I physically boot up and login to Windows 7. Now I want to access Xubuntu, so I load VirtualBox and access my Xubuntu partition without rebooting. And the other way around too, i.e. I boot up the system, login to Xubuntu, and can access the actual Windows 7 partition through VirtualBox.

Other info: Please note that I am not talking about getting access to files, as I have a completely separate partition for my files, and am very familiar with VirtualBox's Shared Folders option.

Source: (StackOverflow)

What is the maximum number of partitions that can be made on a hard drive?

What is the maximum number of partitions we can make on hard disk in Windows?

If it is limited to some particular number, why can we assign all the letters C through Z to drives? If it is a special case, what's that?

Source: (StackOverflow)

Why is windows not able to create a system partition?

I'm reinstalling Windows 7 64 bit, and I encountered an issue I've never seen before. I have a legit copy of Win 64 Professional, and I've installed it probably a half dozen times on this machine in the past without a problem.

Googling the error only brings me to issues with people who are upgrading to win7.

The drive itself seems to not have a problem. I can mount it on other systems and I can create an NTFS partition on it on other machines. I can install Ubuntu on it without any issues. Additionally, if I try using my alternate backup hard drive, the installer gives the same error.

I have run diskpart from the setup page and clean seems to report that all is well. However, I cannot get past the screen below, which says Setup was unable to create a new system partition or locate an existing system partition. This happens regardless of whether or not the disk space is already allocated.

What is causing this? How do I solve or get past this?

A strange error appears

Edit: One Week Later

I am at my wits end with this... I have tried installing windows on four different hard drives, using two completely different motherboards, I even borrowed a copy of Windows 7 Ultimate as well as my legit Win7Pro disk. I have tried with no existing partitions, and with existing (and fully functional) NTFS partitions. I've tried installing off of USB and DVD. Every time I get to the screen shown above I get the same result.

Source: (StackOverflow)

Are GPT partitions less likely to get corrupted than MBR-based partitions?

GPT (GUID Partition Table) partitioning has some benefits over MBR (Master Boot Record), including Support for:

  1. More partitions (128)
  2. Drives larger than 2 TB

But are there any other benefits like less likelihood of corruption? (The two HD failures I've had were corrupt MBRs). Or are you just playing wack-a-mole where the GPT then gets corrupt in the same way?

Source: (StackOverflow)

Why create many partitions?

I have noticed that when installing Ubuntu some people create multiple partitions for directories. Like one for root, one for home, one for boot. What is the advantage to doing this over installing them all on one partition, assuming there is only one hard drive?

Source: (StackOverflow)

What happened to the B: drive in Windows and why does the hard drive default to C?

Why is it that I see an A: drive and a C: drive but not a B: drive?

Is there a reason why the disk partitions start at C? And is it possible to change that letter designation?

Source: (StackOverflow)

Moving the swapfiles to a dedicated partition in Snow Leopard

I have been able to move Apple's virtual memory swapfiles to a dedicated partition on my hard drive up until now. The technique I have been using is described in a thread on

However, with the developer preview of Snow Leopard, this method no longer works. Does anyone know how it could be done with the new OS?

Update: I have marked dblu's answer as accepted even though it didn't quite work because he gave excellent, detailed instructions and because his suggestion to use plutil ultimately pointed me in the right direction. The complete, working solution is posted here in the question because I don't have enough reputation to edit the accepted answer.

Update #2: Changed the procedure to illustrate ekl's technique, which greatly simplifies the whole thing by eliminating the need for an intermediate shell script:

Complete solution:

1. Open Terminal and make a backup copy of Apple's default dynamic_pager.plist:

$ cd /System/Library/LaunchDaemons
$ sudo cp{,_bak}

2. Convert the plist from binary to plain XML:

$ sudo plutil -convert xml1

3. Open the converted plist with your text editor of choice. (I use pico, see dblu's answer for an example using vim):

$ sudo pico -w

It should look as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "$
<plist version="1.0">

4. Modify the ProgramArguments array (lines 13 through 18) to use the wait4path shell command (as suggested by ZILjr) prior to launching dynamic_pager. See note #1 for details on why this is necessary. In the following example, my partition is called 'Swap', and I chose to put the swapfiles in a hidden directory on that partition, called '.vm' be sure that the directory you specify actually exists. The XML should look as follows:

    <string>/bin/wait4path /Volumes/Swap/ &amp;&amp;
/sbin/dynamic_pager -F /Volumes/Swap/.vm/swapfile</string>

5. Save the plist, and return to the terminal prompt. Using pico, the commands would be:

<ctrl+o> to save the file
<enter>  to accept the same filename (
<ctrl+x> to exit

6. Convert the modified plist back to binary:

$ sudo plutil -convert binary1

7. Restart your Mac. If you run into trouble, switch to verbose startup mode by holding down Command-v immediately after the startup chime. This will let you see all of the startup messages that appear during startup. If you run into even worse trouble (i.e. you never see the login screen), hold down Command-s instead. This will boot the computer in single-user mode (no graphical UI, just a command prompt) and allow you to restore the backup copy of that you made in step 1.

8. Once the computer boots, fire up Terminal and verify that the swap files have actually been moved:

$ cd /Volumes/Swap/.vm
$ ls -l

You should see something like this:

-rw-------  1 someUser  staff  67108864 18 Sep 12:02 swapfile0

9. Delete the old swapfiles:

$ cd /private/var/vm
$ sudo rm swapfile*

10. Profit!

Note 1

Modifying the arguments to dynamic_pager in the plist without using wait4path does not always work, and when it fails, it does so in a spectacularly silent way. The problem stems from the fact that dynamic_pager is launched very early in the startup process. If your swap partition has not yet been mounted when dynamic_pager is first loaded (in my experience, this happens 99% of the time), then the system will fake its way through. It will create a symbolic link in your /Volumes directory which has the same name as your swap partition, but points back to the default swapfile location (/private/var/vm). Then, when your actual swap partition mounts, it will be given the name Swap 1 (or YourDriveName 1). You can see the problem by opening up Terminal and listing the contents of your /Volumes directory:

$ cd /Volumes
$ ls -l

You will see something like this:

drwxrwxrwx  11 yourUser  staff   442 16 Sep 12:13 Swap -> private/var/vm
drwxrwxrwx  14 yourUser  staff     5 16 Sep 12:13 Swap 1 
lrwxr-xr-x   1 root      admin     1 17 Sep 12:01 System -> /

Note that this failure can be very hard to spot. If you were to check for the swapfiles as I show in step 12, you would still see them! The symbolic link would make it seem as though your swapfiles had been moved, even though they were actually being stored in the default location.

Note 2

I was originally unable to get this to work in Snow Leopard because was stored in binary format. I made a copy of the original file and opened it with Apple's Property List Editor (available with Xcode) in order to make changes, but this process added some extended attributes to the plist file which caused the system to ignore it and just use the defaults. As dblu pointed out, using plutil to convert the file to plain XML works like a charm.

Note 3

You can check the Console application to see any messages that dynamic_pager_init echos to the screen. If you see the following lines repeated over and over again, there is a problem with the setup. I ran into these messages because I forgot to create the '.vm' directory that I specified in dynamic_pager_init.[1]  ([176]) Exited with exit code: 1[1]  ( Throttling respawn: Will start in 10 seconds

When everything is working properly, you may see the above message a couple of times only, and then no more of the "Throttling respawn" messages. This means that the system did have to wait for the partition to load, but in the end it was successful.

Source: (StackOverflow)

What is the recommended boot partition size for Windows 7?

I started using one big partition for everything and separating data out with folders when I got my current computer years ago. I'm preparing to upgrade my system from Windows XP to Windows 7, and I thought I might go back to putting my data on a separate partition.

Most likely I'll just use the default OS install. My current Program Files tree has ~16 GB of stuff.

Thinking ahead though, I've had Windows XP installed for years. Who knows what applications I'm going to install down the line?

This, of course, begs the question: How big do I make my Windows 7 install partition?

Source: (StackOverflow)

Windows detects GPT disk as MBR in EFI boot

This disk is OCZ VERTEX 128GB SSD. It is formatted as GPT from OSX. The disk layout is,

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *128.0 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                 Apple_RAID                         63.8 GB    disk1s2
   3:                 Apple_Boot Boot OS X               134.2 MB   disk1s3
   4:       Microsoft Basic Data ssdwin                  63.9 GB    disk1s4

I'm trying to install windows7 in the "ssdwin" partition but when i EFI Boot windows 7 64bit USB installer, it says,

Windows cannot be installed to this disk. The selected disk has a mbr partition table, On EFI system window can only be installed to GPT disks.

But my disk is GPT disk. any idea how i can recover from this ?

Source: (StackOverflow)

How to rename a partition in OS X?

I'm able to erase a partition using the Disk Utility, but I want to change the name without losing data. How is it possible?

Source: (StackOverflow)

Disadvantages of partitioning an SSD?

A wise guy who goes by the name of NickN maintains a lenghty forum post on his views about building a powerful computer (directed towards playing Microsoft's Flight Simulator X, a very demanding piece of software).

He sums up points about SSD drives somewhere, and he concludes the list as follows:


He doesn't elaborate on this unfortunately, but I wonder why he says this. What are the drawbacks of partitioning an SSD? (Partitioning in this context meaning >= 2 partitions)

Source: (StackOverflow)

Moving users folder on Windows Vista/7 to another partition

When I format the computer and reinstall Windows, my first step is move the My Documents folder to another partition. In Windows XP it wasn't enough because the desktop folder and another user folders was in the primary partition.

Now in Windows Vista and 7 we can use junctions/symlinks to "move" the folder to another partition and Windows and another programs will think that the data is in the primary partition.

What the fastest and secure steps to move the Users folder to another partition and to create the hardlinks correctly?

Source: (StackOverflow)