reformat hard disk
I want to completely erase and reformat a hard disk.
I have 2 hard disks, 160gb (hda) and 60 gb (hdb) respectively. The 160 is the boot disk. I have removed all files from the 60 gb. Here is info about disks: SuSEBox:~ # fdisk -l Disk /dev/hda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 1 131 1052226 82 Linux swap / Solaris /dev/hda2 132 19456 155228062+ 83 Linux Disk /dev/hdb: 60.0 GB, 60022480896 bytes 255 heads, 63 sectors/track, 7297 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hdb1 * 1 13 104391 83 Linux /dev/hdb2 14 7134 57199432+ 83 Linux /dev/hdb3 7135 7297 1309297+ 82 Linux swap / Solaris Disk /dev/sda: 528 MB, 528482304 bytes 32 heads, 32 sectors/track, 1008 cylinders Units = cylinders of 1024 * 512 = 524288 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 1007 515568 6 FAT16 The hdb* is from the fact the this disk was previously a boot disk (It was RedHat9, i don't know what the "Solaris" is doing in there) but now i just want it for data, no booting. What command(s) should I perform to reformat this disk? and what should i put in /etc/fstab? something like this? (calling it "bdrive") /dev/hdb /mnt/bdrive ext3 auto 1 1 |
mkfs is the command used to format disks
e.g. mkfs -t ext3 /dev/hdb1 If you want to make the single drive a whole partition, you need to change the partitioning using fdisk or cfdisk (cfdisk is probably easier), then format each partition you create. BTW, the "Solaris" is the linux swap partition, it can be deleted using fdisk/cfdisk Here is the RedHat 7.3 guide to using fdisk and mkfs. http://www.redhat.com/docs/manuals/l...t3-create.html Google will reveal even more helpful info, but be sure to post back to tell us whether it worked or not. and yes, that's almost exactly what you'd put in /etc/fstab, except that you have to have the partition number, you can't mount a whole drive e.g. /dev/hdb3 /mnt/bdrive/ ext3 auto 1 1 |
It worked, thanks, here's what I did.
SuSEBox:~ # umount /mnt/bdrive umount: /mnt/bdrive: device is busy umount: /mnt/bdrive: device is busy SuSEBox:~ # fuser -u /mnt/bdrive /mnt/bdrive: 5895(root) SuSEBox:~ # fuser -k /mnt/bdrive /mnt/bdrive: 5895 No automatic removal. Please use umount /mnt/bdrive SuSEBox:~ # umount /mnt/bdrive SuSEBox:~ # mkfs -t ext3 /dev/hdb1 mke2fs 1.35 (28-Feb-2004) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) 26104 inodes, 104388 blocks 5219 blocks (5.00%) reserved for the super user First data block=1 13 block groups 8192 blocks per group, 8192 fragments per group 2008 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 36 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. SuSEBox:~ # cfdisk /dev/hdb (This gives a menu in which i deleted partitions on /dev/hdb, then added one partition for the whole disk) Then I had to change permissions so that users other than root could write to it. Thanks for your help. |
i am having a problem with the new partition .
I'm getting a disk full when copying files. It will always copy the folders, but it won't copy files. I'm using KDE Konqueror as a file manager. I drag a folder to the new partition and it copies the folders (and folders within it) and then a dlg box pops up saying the disk is full. If i then drag another folder, it copies the folders (and folders within it) and then a dlg box pops up saying the disk is full. The partition looks good: SuSEBox:~ # fdisk -l /dev/hdb Disk /dev/hdb: 60.0 GB, 60022480896 bytes 16 heads, 63 sectors/track, 116301 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System /dev/hdb1 1 116301 58615672+ 83 Linu What is the problem? |
When reformatting the disk, I needed to switch the order of mkfs and cfdisk
|
All times are GMT -5. The time now is 12:54 AM. |