NavigationUser loginSpam?See spam posts on this site? If so, please don't reply to the spam! Instead, just report the URL to the webmaster. |
formatting a hard driveI just installed debian 4 on a computer which had windows and ubuntu with dual boot. I installed debian over the windows partiton and now wish to reformat the 200gb hd which ubuntu is installed on. I tried formatting the drive with disk manager in debian but it wont let me access the drive afterwards. It also asks for an access path when you try to format it. Can someone help me out? |
can use mkfs to format
I am not familiar with disk manager, but you can format a disk using mkfs. I would make sure you can mount the device so you are certain that you are formatting the correct drive.
Mounting the Disk
To mount the disk, you need a valid entry in /etc/fstab. Depending on the type of hard drive, the corresponding device for your first installed drive is typically /dev/hda or /dev/sda. The second installed drive would be /dev/hdb or /dev/sdb. IDE drive device names begin with hd and SCSI device names begin with sd.
So if your disk to format is the second drive, the /etc/fstab entry would look something like this:
# /etc/fstab: static file system information.
#
#
/dev/hdb1 /backup ext3 defaults 0 2
The "1" after /dev/hdb says that you are mounting the first partition of device /dev/hdb. If your device has multiple partitions, there would be separated lines with /dev/hdb1, /dev/hdb2, and so forth. "ext3" specifies that the filesystem is ext3.
One of the "defaults" options is to mount at boot time, so if the directory /backup exists on your root filesystem, your drive would be mounted there after booting. To mount without rebooting, run this as root:
# mount /backup
Once you have mounted the disk, you can browse through its file system to make sure this is really your ubuntu disk. At this point, you need to decide if you want to repartition the disk. You may be happy with the current partitions. In fact, you may very well be happy with the filesystem. In this case, you could just erase the contents of the disk without reformatting.
Reformatting
If you do need to reformat, then you can use
# mkfs -t ext3 /dev/hdb1
if your device is /dev/hdb1 and you want an ext3 filesystem. At the bottom of the mkfs man page, other valid filesystem types are listed. ext3 is always a safe bet, being the default Linux filesystem type.
Now the mkfs man page says you can specify a mount point and format a mounted disk. I always feel safer unmounting the disk first using umount, and specifying the device path on the mkfs command line.