LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 12-16-2004, 07:29 PM   #1
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Rep: Reputation: 30
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
 
Old 12-16-2004, 08:04 PM   #2
TexasDex
Member
 
Registered: Feb 2003
Location: The Attic. Nowhere near Texas.
Distribution: Gentoo, Kubuntu, formerly LFS, SuSE, and RedHat
Posts: 133

Rep: Reputation: 15
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
 
Old 12-16-2004, 10:36 PM   #3
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
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.
 
Old 12-17-2004, 12:54 PM   #4
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
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?
 
Old 12-18-2004, 08:35 AM   #5
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
When reformatting the disk, I needed to switch the order of mkfs and cfdisk
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cloning 1 hard disk to smaller hard disk, dd or ghost? fireman949 Linux - Hardware 8 12-23-2012 12:51 AM
disk errors... need to reformat ahimsel08 Linux - Hardware 1 06-12-2004 01:14 AM
cannot reformat hard drive poppybear Libranet 5 05-13-2004 05:24 PM
Hard Disk question - Making a big hard disk MrAnonym Linux - General 2 09-15-2003 06:08 PM
reformat hard drive for dual boot? adroot Linux - Newbie 1 06-12-2002 01:06 PM


All times are GMT -5. The time now is 01:02 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration