Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I recently installed an setup an Ubuntu Server machine. It has two drives in it and the other drive has windows installed on it. (I didn't want to overwrite the windows installation until I had my server setup and working). Now I would like to format that hard drive so that I can use it as a remote time machine backup for my mac.

So my question is, how can I format that drive to be available from the server and also have grub forget about the windows installation? (all without affecting the existing ubuntu installation). Also keep in mind, I need this to either be a command line solution or something I can run from a usb drive.

Thanks!

share|improve this question
2  
This would be better as two separate questions. Removing the entry from Grub is entirely separate from formatting the drive. –  Shawn J. Goff Oct 8 '11 at 2:23
1  
The ubuntu docs have a lot of information about partitioning and formating drives. What problem are you facing specifically? –  Mat Oct 8 '11 at 8:52
add comment

1 Answer

up vote 1 down vote accepted

From the command line: start a root shell (sudo -s). First, unmount the Windows partition if it's mounted. Then list the partitions on your system to see which one is the Windows partition:

fdisk -l

Given your disk arrangement, the Windows partition is likely to be /dev/sdb1 (first partition (1) of the second disk (b)). To confirm, run file - </dev/sdb1, which should report an NTFS filesystem.

Create a Linux filesystem on the partition:

mkfs.ext4 /dev/sdb1

Change the partition type (this isn't strictly necessary as Linux doesn't care, but having contradictory information is likely to be confusing):

fdisk /dev/sdb
t
1
83
w

Obtain the UUID of the newly created filesystem:

blkid -s UUID -o value /dev/sdb1

Edit /etc/fstab. Remove the entry corresponding to the former Windows filesystem, and add an entry corresponding to the new Linux filesystem.

UUID=01234567-89ab-cdef-0123-456789abcdef /BACKUPS ext4 errors=remount,ro 0 2

Mount the new filesystem with mount /BACKUPS (this will be performed automatically at boot time).

Finally, run update-grub to regenerate the Grub boot menu. Since the Windows installation has disappeared from the disk, it will disappear from the boot menu.

share|improve this answer
    
Personally I'd change the partition type before doing the mkfs. –  Paul Tomblin Oct 10 '11 at 0:23
    
thank you so much for the clear writeup! –  drewag Oct 10 '11 at 2:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.