LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 08-03-2004, 12:28 AM   #1
jnassiri
Member
 
Registered: Aug 2004
Location: Arlington, TX
Distribution: SuSE linux 9.1 personal
Posts: 32

Rep: Reputation: 15
Formating hard drive?


I've just recently installed SuSE linux 9.1 and have an 80 gb hard rive that needs to be formated. so I was wondering what kind of free program would be good to format it so I can put all my music that's backed up on dvds, on to the hard drive...any suggestions would be greatly appreciated.
 
Old 08-03-2004, 01:48 AM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
To format a drive, it needs to be unmounted first. Example:
Code:
umount /dev/hdx
mkfs -t ext3 /dev/hdx
mount /dev/hdx <mountpoint>
where "x" is the partition letter and <mountpoint> is the mount point to which you want to attach the partition once it has been partitioned. In slightly more detail, step 1 unmounts the drive, step 2 makes the filesystem ("mkfs") of type ext3 (you can use whatever format you prefer), and step 3 will mount the newly formatted partition to the directory you want. See the man pages for mkfs for more details. Good luck with it, and welcome to LQ. -- J.W.
 
Old 08-03-2004, 01:53 AM   #3
OEP
Member
 
Registered: Apr 2004
Location: AL, USA
Distribution: FC4, Gentoo
Posts: 58

Rep: Reputation: 15
Linux has commands for formatting. I'm assuming your device is going to be hdb and you only put one partition on that drive. You might want to confirm that.

depending on what filesystem you want:

vfat:
# /sbin/mkdosfs /dev/hdb1

ext3 (better for linux =D)
# /sbin/mkfs.ext3 /dev/hdb1

The only things that would need to change is that number after hdb depending on your partitions and hdb might be different also. I think you can check with the command 'df -h'
 
Old 08-03-2004, 11:06 PM   #4
jnassiri
Member
 
Registered: Aug 2004
Location: Arlington, TX
Distribution: SuSE linux 9.1 personal
Posts: 32

Original Poster
Rep: Reputation: 15
J.W. I tried what you said but none of those commands seemed to work...can you tell me how exactly I need to use them maybe...thanks.
 
Old 08-03-2004, 11:29 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
It's not recommended to use the rawdevice ...

Become root
Code:
su -
Check the partitioning of the hdd ...
If you're not sure which physical device is
the hdd, try
fdisk -l

It should display the information about partitions
on all hdd's in your system. If you're certain that
the info for a particular device matches the drive
you want formatted you have to check whether it
has the partitioning you wanted.

If it does, try
mkreiserfs /dev/hd<xN>
where x is the physical devices letter, and N the
partition number you want to format ...

If partitioning is not what you want it to be, use
fdisk (cfdisk, ... ) to re-parititon the drive ...

man fdisk
for details ...


Cheers,
Tink
 
Old 08-04-2004, 01:11 AM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
First, Tinkster's reply is better than mine, and I should have included the partition number as part of my reply, as well as to have indicated more clearly that you do need to be running as root rather than as a regular user. (Thanks, Tink)

So, hopefully this more detailed reply will make up for it. Starting from the very beginning, and given that you've got a brand new drive you want to install, the first question is to determine where the new drive will be installed. For reference:

/dev/hda = primary master
/dev/hdb = primary slave
/dev/hdc = secondary master
/dev/hdd = secondary slave

(If the drive is already installed, then running the "fdisk -l" command can be used to confirm the position of each hard drive, as well as to display the existing partition information.) Secondly, you would need to determine how you wanted to partition the new disk - do you want to create a single 80G partition, or split it into two 40G partitions, or set it up as two 25G and one 30G partition, etc. Once you've decided, use a partitioning tool such as fdisk or cfdisk (which is the one I prefer) to define your partitions. Using cfdisk as an example, and assuming that the new drive is the secondary slave, you would enter the command (as root):
Code:
cfdisk /dev/hdd
and then create the partition(s) as you wish. The key remaining task would be to perform the actual formatting, and the question to answer there is "which file system do you want to use?" Linux supports several, but I'd recommend using the same file system that your computer is already using in order to keep things consistent. As Tinkster indicated, the default file system type with Suse is reiserfs, and so in your situation the best command to format the partition would be
Code:
mkreiserfs /dev/hdxy
where "x" is the partition letter and "y" is the partition number. To illustrate, if you partitioned the 80G drive into 2 halves, and it were installed in the secondary slave position, the commands you would enter would be "mkreiserfs /dev/hdd1" and "mkreiserfs /dev/hdd2". The end result would be that you'd have your new 80G drive divided into two 40G partitions, each of which is using the same file system as your existing Suse system. At this point, the original issue would be settled.

Finally, in order to have those new partitions be mounted automatically as part of the bootup process, you would want to add them to the fstab file (which exists in the /etc directory).

Hopefully that clarifies things, and sorry about the skimpy answer I originally supplied. I would also say that partitioning questions are very common, and there are numerous threads here at LQ that go into the issue in great detail. You could use the Search function with the keyword "partition" to locate any relevant threads. Good luck with it. -- J.W.
 
  


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
Formating a new external hard drive SpartacusJones Linux - Hardware 1 01-02-2005 06:28 AM
formating hard drive icanspellnew Linux - General 9 11-13-2004 04:56 PM
formating / partitioning a new hard drive true_atlantis Linux - Hardware 15 12-07-2003 07:09 PM
Formating Hard Drive Zakane Linux - Newbie 20 08-25-2003 01:13 PM
Formating 2 hard drive Tenchi147 Linux - Hardware 1 05-31-2003 06:01 PM


All times are GMT -5. The time now is 01:53 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration