Posted by: rakitha | March 3, 2011

How to Install A new Internal Hard Drive

I recently had to install new 2TB hard drive for my desktop which runs on Red Hat Enterprise Edition (version:2.6.18-238.1.1.el5PAE). I was able to successfully install the hard drive, create a single partition of type ext3. I used parted and mkfs.ext3

First install the hard drive physically. Boot the computer and open a terminal. Check to see the hard drive in the /dev directory. If you installed a sata drive do the following,

ls /dev/sd*

for ata drive,

ls /dev/hd*

The standard format is that sda/hda is you primary boot hard drive. So you installed drive should be the sdb/hdb. Note that if you already had more than one drive installed then your letter corresponding to the new drive could be different.

Here is the procedure for correctly setting up the hard drive to have ext3 file system
, My new hard drive is sdb

  1. Open a terminal and log in as super user (use su)
  2. Then type
    parted /dev/sdb

    and here is the parted terminal

    GNU Parted 1.8.1
    Using /dev/sdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
  3. Now create the partition label for the new drive. Since this my drive is 2TB, I’m going to use the label gpt but you could use the label msdos. So type
    (parted) mklabel

    And follow the steps as given below

    Warning: The existing disk label on /dev/sdb will be destroyed and all data on
    this disk will be lost. Do you want to continue?
    Yes/No? yes
    New disk label type?  [msdos]? gpt

    Now to check the status use ‘p’ or ‘print’ command

    (parted) p                                                                
    
    Model: ATA Hitachi HDS72202 (scsi)
    Disk /dev/sdb: 2000GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start  End  Size  File system  Name  Flags

    If you see this, you are now ready to create a partition in the disk.

  4. To create a partition type following
    (parted) mkpart primary 0 -0

    And check the status again

    (parted) p                                                                
    
    Model: ATA Hitachi HDS72202 (scsi)
    Disk /dev/sdb: 2000GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name     Flags
     1      17.4kB  2000GB  2000GB               primary

    Now you are done with the parted so exit

    (parted) quit
  5. Now you have created a partition in the disk and if you type, ls /dev/sdb* you will notice two entries for the sdb drive. sdb and sdb1.
  6. To create the file system ext3 on the partition sdb1, use mkfs.etx3 command.
    mkfs.ext3  -m 0 /dev/sdb1
    mke2fs 1.39 (29-May-2006)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    244203520 inodes, 488378637 blocks
    0 blocks (0.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=0
    14905 block groups
    32768 blocks per group, 32768 fragments per group
    16384 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
            102400000, 214990848
    
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done
    
    This filesystem will be automatically checked every 22 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.

    Now you are done with setting up the hard drive and only thing left to do is mounting it so the drive can be used.

  7. Now create a directory to mount the drive and change its owner to your user name
    mkdir mount_dir
    chown username mount_dir
  8. To mount this drive automatically at the boot time, one have to enter an entry to /etc/fstab file. So I have given below entries in my fstab file
    less /etc/fstab
    LABEL=/                 /                       ext3    defaults                     1 1
    LABEL=/home             /home                   ext3    defaults                     1 2
    LABEL=/local            /local                  ext3    defaults                     1 2
    LABEL=/boot             /boot                   ext3    defaults                     1 2
    tmpfs                   /dev/shm                tmpfs   defaults                     0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620               0 0
    sysfs                   /sys                    sysfs   defaults                     0 0
    proc                    /proc                   proc    defaults                     0 0
    LABEL=SWAP-sda5         swap                    swap    defaults                     0 0
    /dev/sdb1               /mnt/dd                 ext3    defaults                     1 1


    SO you can copy the last entry
    /dev/sdb1 /mnt/dd ext3 defaults 1 1
    and change to your drive name and mounting directory name

  9. Now all you have to do is mount the new drive
    Use mount to do that 

    mount /dev/sdb1 /mnt/dd

    and check using df to verify the disk is mounted.

    df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda3             9.5G  5.5G  3.6G  61% /
    /dev/sda6             438G  224G  192G  54% /home
    /dev/sda2             2.9G   69M  2.7G   3% /local
    /dev/sda1             251M   27M  212M  12% /boot
    tmpfs                 2.0G   12K  2.0G   1% /dev/shm
    /dev/sdb1             1.8T  196M  1.8T   1% /mnt/dd
  10. Now you are ready to use your new disk drive
About these ads

Responses

  1. […] Dell XPS M 1710?What’s the highest capacity for a Serial ATA Internal hard drive for a laptop?How to Install A new Internal Hard Drive var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-17225958-1']); _gaq.push(['_trackPageview']); […]

  2. […] #split {}#single {}#splitalign {margin-left: auto; margin-right: auto;}#singlealign {margin-left: auto; margin-right: auto;}#splittitlebox {text-align: center;}#singletitlebox {text-align: center;}.linkboxtext {line-height: 1.4em;}.linkboxcontainer {padding: 7px 7px 7px 7px;background-color:#eeeeee;border-color:#000000;border-width:0px; border-style:solid;}.linkboxdisplay {padding: 7px 7px 7px 7px;}.linkboxdisplay td {text-align: center;}.linkboxdisplay a:link {text-decoration: none;}.linkboxdisplay a:hover {text-decoration: underline;} function opensplitdropdown() { document.getElementById('splittablelinks').style.display = ''; document.getElementById('splitmouse').style.display = 'none'; var titleincell = document.getElementById('titleincell').value; if (titleincell == 'yes') {document.getElementById('splittitletext').style.display = 'none';} } function closesplitdropdown() { document.getElementById('splittablelinks').style.display = 'none'; document.getElementById('splitmouse').style.display = ''; var titleincell = document.getElementById('titleincell').value; if (titleincell == 'yes') {document.getElementById('splittitletext').style.display = '';} } The games of xbox 360 will be the same as for the new xbox 360 slimHow to Install A new Internal Hard Drive […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: