DPREVIEW

I'm actively participating dpreview.com now and time to time I won so I decided to put my won entries here.

Kutch Profile

 

20th Place

21

 

47 Placer

 

 

 

 

 

How to format new hard drive in Linux
I.T. WORLD - Open Source Corner
Monday, 04 January 2010 11:14

There are many manuals or how-to everywhere in website, but in this case I will make it very KISS (Keep It Simple Stupid!)

ISSUE: I want to format a newly purchase hard drive to be a Linux ready file system (it can be IDE, SATA, SCSI) but in this case I use SATA 750 GB

SOLUTION:

1. First I plug SATA Hard Drive to it's proper SATA slots, in my case I plug to SATA3 coz SATA0,1,2 are occupied already. Remember when you plug your SATA you have to put power supply as well, there are two types of power supply now a days the white one a typical for IDE and the latest one is the black with many pins. Note: if you purchase SATA that has two power supply just plug only one.

2. Boot your Linux box

3. If you are not a text based savvy no worries use gparted or qtparted but can be used as GUI base, but in this How-to I will teach the classic old school, the text based. For GUI user go ahead with Next Next Ok Ok mouse procedure, for text savvy let's go ahead.

 

4. First thing identify your device, I use gparted to view the device easily
kutch@dorkbox:~$ sudo gparted
Then I saw on the upper box /dev/sdb (698.64 GiB)

4. I've been recomend to use log file instead using gui stuff (* was recomended by Andy F www.x31.com/~andy) 

4.1 type this command kutch@dorkbox:~$ tail -f /var/log/messages
4.2 First Plug your USB
4.3 You will in the shell where you type the tail command the newly plug device, it will show something like this

Apr 26 08:55:45 dorkbox kernel: [ 3184.116000] usb 5-6: new high speed USB device using ehci_hcd and address 5
Apr 26 08:55:45 dorkbox kernel: [ 3184.248000] usb 5-6: configuration #1 chosen from 1 choice
Apr 26 08:55:45 dorkbox kernel: [ 3184.248000] scsi3 : SCSI emulation for USB Mass Storage devices
Apr 26 08:55:50 dorkbox kernel: [ 3189.248000] scsi 3:0:0:0: Direct-Access     Maxtor 6 E040L0           0811 PQ: 0 ANSI: 0
Apr 26 08:55:50 dorkbox kernel: [ 3189.252000] sd 3:0:0:0: [sdb] 80293248 512-byte hardware sectors (41110 MB) 

4.4 so this means you have /dev/sdb device

5.Now it is identified then lets start, fdisk your drive

kutch@dorkbox:~$ sudo fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x2770bd33.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.


The number of cylinders for this disk is set to 91201.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n

Command action
e extended
p primary partition (1-4)

p

Partition number (1-4): 1
First cylinder (1-91201, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-91201, default 91201): 91201

Command (m for help): t

# t means change a partition's system id

Selected partition 1
Hex code (type L to list codes): 83

#83 Means Linux

Command (m for help): w

# W Means Write to table

Calling ioctl() to re-read partition table.
Syncing disks.

6. Now you formated already the dis, you have to make the disk a file system, in my case I created EXT3

kutch@dorkbox:~$ sudo mkfs.ext3 /dev/sdb1

Note: why I did not set to /dev/sdb? Answer I'm not writing including MBR I just want to have a Storage

7. Ops don't be excited we are almost done. You still have to label your disk, In my case I have to because I have 4 Sata Drives and 2 Identical Capacities, let's label the disk now

kutch@dorkbox:~$ sudo e2label /dev/sdb1 "KM33_750GB_I_01"

8. Ok we are done but how to use the new drive? It is simple use mount command

kutch@dorkbox:~$ sudo /dev/sdb1 /media/sdb1

That's all folks!

 

Add comment


Security code
Refresh

Avast Free

Free AVAST Anti-Virus

Download Here

Your license key is:
---------- cut here ----------
C24683153H1200A0512-KRRTYWF2
---------- cut here ----------
Expiry: June 22, 2011

Google Ads