LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 10-02-2004, 09:07 AM   #1
rundjuling
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2
Posts: 30

Rep: Reputation: 15
Installed new hard drive - need to format it


Hi!

I recently bought a 200 GB HD that I just installed. What I need to do now is to format it, and I've looked through some sites to see how I can use fdisk and such, but I have some questions still. I have another (and much, much smaller) HD in my system already that I have installed RedHat 8 and where I have all my files.
I want to know how I should format the new disk, and I don't need a boot section and stuff. How would you recommend formatting and partitioning a HD like that? I'm using this PC as a workstation.

Thanks for any help!
 
Old 10-02-2004, 10:30 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
If you are just using it for data storage then I would just create a single partition and format it with reiserfs.
 
Old 10-02-2004, 10:53 AM   #3
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
Hi,

1. First, find out what the device is where linux "sees" the new drive. E.g. if it's master on the second IDE bus, it will be /dev/hdc.
The easiest way to get this right is to open a console and type "dmesg | grep ^hd"
Then you will see the names of all drives as well as their capacity.

For the following I will assume it's hdc

You should also choose which type of filesystem you would like. ext2 and ext3 are most common, the difference being ext3 survives crashes without the need to do a complete check afterwards. There is also reiserfs, which is less common but higher performance, and also survives disk crashes without the need to do a check. Or you can use fat32 for a dual boot system where you also want the data to be accessible through windows.

2. Partition the new drive. You will probably just want one big partition of 200GB. A good tool for this is "parted". Do "parted /dev/hdc" (as root). It gives it's own prompt, now give it the command "print". It shouldn't show any existing partitions, otherwise you took the wrong drive (your older hd) and that could be disastrous later on It also shows the total amount of MB's available.

Now it's time to create the new partition: "mkpartfs primary type 0 size"
where type is either ext2, fat32, or reiserfs; and size is the size in megabytes that was shown by "print".

Then "quit" to exit parted.

The nice thing about parted is that it will ALSO automatically format the partition for you. So you don't need to do that in advance.
Beware, if you want to use reiserfs, I don't know if Red Hat supports it by default. It may be possible you need to install some rpm first!

3. Now, to be able to mount the partition, add a line in /etc/fstab (use your favorite editor). The line should read
Code:
/dev/hdc1   /newdrive   type    defaults 1 1
Where type is reiserfs, ext2, or vfat (for fat32)
See http://www.tuxfiles.org/linuxhelp/fstab.html for more info on this.

4. The directory whereyou want to mount the drive must be created.

5. Fill the drive with data

Hope this works OK for you
nukkel

Last edited by nukkel; 10-02-2004 at 10:54 AM.
 
Old 10-02-2004, 01:15 PM   #4
rundjuling
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks a lot for your reply, nukkel!

The new HD is located at /dev/hdb.

I met a problem when I wrote "parted /dev/hdb" as root. Among a lot of other messages, this one showed up:
"Using /dev/hdb
Error: Unable to open /dev/hdb - unrecognised disk label."
Do you know what that means?

And nothing shows up when typing "dmesg | grep ^hd" either. I believe I put the jumper on the disk correctly as slave.

The rest of your format and partition guide looks promising, and I look forward to try it out when I have these problems solved. Thanks again!

And btw, do you think one big 200 GB partition is a good thing or should I part it into smaller partitions?

Last edited by rundjuling; 10-02-2004 at 01:17 PM.
 
Old 10-02-2004, 01:39 PM   #5
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
No problem!

Quote:
Originally posted by rundjuling
I met a problem when I wrote "parted /dev/hdb" as root. Among a lot of other messages, this one showed up:
"Using /dev/hdb
Error: Unable to open /dev/hdb - unrecognised disk label."
Do you know what that means?
That's weird, but parted has been known to be a bit "picky" of bios etc... -- maybe better try "fdisk" then, but then you'll need to do the formatting by hand after partitioning. I don't know by heart how to use fdisk, but i think it's a bit similar

Quote:

And nothing shows up when typing "dmesg | grep ^hd" either. I believe I put the jumper on the disk correctly as slave.
When just typing "dmesg", does it give anything at all? If it doesn't, the same data (i.e. the boot log) can also be found (usually) in the file /var/log/boot.log
If there's no line somewhere in it like "hdb: make/model, xxxxxxx sectors" then there is a problem with cables/jumpers

Quote:

And btw, do you think one big 200 GB partition is a good thing or should I part it into smaller partitions?
That's entirely up to you -- in linux there is no technical reason you shouldn't make 1 big partition (it should only be smaller then 4TB (=4096GB) ) ; it depends on what you want to use the drive for.

So please let me know if you find anything about hdb in "dmesg" or in /var/log/boot.log ... if not, check BIOS settings or cables...

good luck!
nukkel
 
Old 10-02-2004, 02:00 PM   #6
rundjuling
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by nukkel
When just typing "dmesg", does it give anything at all? If it doesn't, the same data (i.e. the boot log) can also be found (usually) in the file /var/log/boot.log
If there's no line somewhere in it like "hdb: make/model, xxxxxxx sectors" then there is a problem with cables/jumpers
"dmesg" didn't give me any output other than numerous messages from the dvd-player.

And the boot.log file didn't contain that like you wrote there. So I guess I have to recheck my cables and jumper settings again. I guess it is slave it's supposed to be, and I thought that was what I said it should be. Anyway.

Quote:
So please let me know if you find anything about hdb in "dmesg" or in /var/log/boot.log ... if not, check BIOS settings or cables...
Yeah, both came out negative, so I'm gonna check some cables... Thanks again so far.
 
Old 10-02-2004, 04:26 PM   #7
rundjuling
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2
Posts: 30

Original Poster
Rep: Reputation: 15
Hm, I never thought this was gonna cause this much trouble.

Now I removed the jumper on the HD to really get it a slave, but I don't see that much of a difference. Well, the little beep when turning the PC on went away but I don't get anything listed when typing dmesg | grep ^hd, nor doing the parted /dev/hdb, cause then it would make the error message "Unable to open /dev/hdb - unrecognised disk label.".
But when typing grep hdb /var/log/dmesg, it prints some info about the HD:
Code:
ide0: BM-DMA at 0x10a0-0x10a7, BIOS settings: hda:pio, hdb:DMA
hdb: Maxtor 6Y200P0, ATA DISK drive
hdb: 398297088 sectors (203928 MB) w/7936KiB Cache, CHS=24792/255/63, UDMA(33)
hdb: unknown partition table
Not easy to figure out...
 
Old 10-02-2004, 05:21 PM   #8
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
At least we're sure the kernel sees the drive. It's strange, I never had this problem with parted. Well, maybe use another program for partitioning, if you have sfdisk, you can do the following (sfdisk has a somewhat awkward syntax):
Code:
cat ";" | sfdisk /dev/hdb
I haven't tried this myself (naturally ) but this should create one big partition

It is possible to check if it turned out OK, by doing "sfdisk -l -V /dev/hdb"
After that, if it worked, it will still need to be formatted:

mke2fs /dev/hdb1 (for an ext2),
mke2fs -j /dev/hdb1 (for ext3),
mkreiserfs /dev/hdb1 (reiser), or
mkdosfs -F 32 /dev/hdb1 (fat32)

Hold on
 
Old 10-02-2004, 06:40 PM   #9
rundjuling
Member
 
Registered: Jul 2003
Distribution: Fedora Core 2
Posts: 30

Original Poster
Rep: Reputation: 15
sfdisk didn't work too well either. Not better than the other options, I think.
Perhaps I should try on fdisk then.
 
Old 10-30-2004, 03:30 AM   #10
Samuraisquirrel
LQ Newbie
 
Registered: Oct 2004
Posts: 1

Rep: Reputation: 0
First off thanks nukkel for the get walk through on the hard drive setup. It really helped me get my WD-200gig hard drive up and running, but I ran into one small problem.

I tried to setup permissions so that the root wasn't the only user that could write to the drive, but it keeps telling me that I don't have sufficient status to change the permissions even though I am logged in as root. I am sure that this is just a newbie problem but I sure could use some help.

I am running Suse 9.1 if that makes a difference.

Thanks
 
Old 10-30-2004, 12:24 PM   #11
Samuraisquirrel
LQ Newbie
 
Registered: Oct 2004
Posts: 1

Rep: Reputation: 0
First off thanks nukkel for the get walk through on the hard drive setup. It really helped me get my WD-200gig hard drive up and running, but I ran into one small problem.

I tried to setup permissions so that the root wasn't the only user that could write to the drive, but it keeps telling me that I don't have sufficient status to change the permissions even though I am logged in as root. I am sure that this is just a newbie problem but I sure could use some help.

I am running Suse 9.1 if that makes a difference.

Thanks

Sorry for the Double post -_-
 
Old 11-15-2004, 05:32 AM   #12
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
Hi, I've been away from linuxquestions.org awhile...

Have you by any chance used the vfat (=FAT32) file system? It cannot store permission/user/group information, so with this filesystem it's impossible to change permissions. In this case, you can make all files on it appear to have a certain permission/user/group by editing the /etc/fstab entry for it: add umask=0 to the option field to give full access to everyone.

If you're using ext2/ext3/reiser, then sth else is wrong...
 
Old 04-04-2007, 08:54 PM   #13
dragonecc
LQ Newbie
 
Registered: Apr 2007
Posts: 1

Rep: Reputation: 0
Hello guys, I have to say I'm having the same problem as rundjuling with the exception my HDD has a corrupted NTFS partition on it. Recently I was think on formating to use it as backup. I'm using a USB to IDE connector so the drive shows ups as /dev/sda also the drive its a Seagate st340015a
Here is my dmesg output.

[17179599.188000] [drm] writeback test succeeded in 2 usecs
[17179600.836000] apm: BIOS not found.
[17179605.444000] NET: Registered protocol family 10
[17179605.444000] lo: Disabled Privacy Extensions
[17179605.444000] ADDRCONF(NETDEV_UP): eth0: link is not ready
[17179605.444000] IPv6 over IPv4 tunneling driver
[17179616.348000] eth1: no IPv6 routers present
[17179673.660000] ieee80211_crypt: registered algorithm 'WEP'
[17179684.224000] eth1: no IPv6 routers present
[17180237.788000] usb 4-3: new high speed USB device using ehci_hcd and address 3
[17180237.920000] usb 4-3: configuration #1 chosen from 1 choice
[17180238.040000] usbcore: registered new driver libusual
[17180238.120000] SCSI subsystem initialized
[17180238.124000] Initializing USB Mass Storage driver...
[17180238.124000] scsi0 : SCSI emulation for USB Mass Storage devices
[17180238.124000] usbcore: registered new driver usb-storage
[17180238.124000] USB Mass Storage support registered.
[17180238.124000] usb-storage: device found at 3
[17180238.124000] usb-storage: waiting for device to settle before scanning
[17180243.124000] usb-storage: device scan complete
[17180243.128000] Vendor: SAMSUNG Model: MP0402H Rev: 0811
[17180243.128000] Type: Direct-Access ANSI SCSI revision: 00
[17180243.160000] SCSI device sda: 78242976 512-byte hdwr sectors (40060 MB)
[17180243.160000] sda: test WP failed, assume Write Enabled
[17180243.160000] sda: assuming drive cache: write through
[17180243.164000] SCSI device sda: 78242976 512-byte hdwr sectors (40060 MB)
[17180243.164000] sda: test WP failed, assume Write Enabled
[17180243.164000] sda: assuming drive cache: write through
[17180243.164000] sda: sda1
[17180243.640000] sd 0:0:0:0: Attached scsi disk sda
[17180243.648000] sd 0:0:0:0: Attached scsi generic sg0 type 0
[17180244.040000] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[17180298.784000] usb 4-3: USB disconnect, address 3
 
  


Reply



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
format a hard drive (/dev/hda1) in Reiser fs format Linh Linux - General 7 06-17-2009 06:30 AM
format hard drive mav69_1999 Linux - Newbie 5 07-08-2004 04:53 PM
Can't format hard drive aisphording Linux - Hardware 5 06-14-2004 04:02 PM
how to format Hard drive?? QuTaR Linux - Newbie 3 09-22-2003 11:23 PM
I can't format my hard drive! help! justin9 Linux - Newbie 9 07-09-2003 07:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration