Wednesday, March 12, 2008

Adding a Hard drive to Linux

So I have a birthday coming up on the 18th of March and I had no idea what I wanted for it. Then the other day I had my laptop battery sitting next to me on some hard drives and it was stupidly next to a candle. Well my table got bumped and the battery was hovering over the candle. Now if you do not know much about lithium-ion batteries if they get too hot they literally explode. Well I noticed this before it exploded but part of the battery was melted. I am too cautious to try and use the battery so I had my girlfriend get me one for my birthday. I know what does this have to do with adding a hard drive in linux, I'm getting there.

So my hard drive died in my MythTV linux box. MythTV is a program for linux that, using a tv capture card, turns your computer into a Tivo like machine, or DVR, or PVR whatever you want to call it. I will talk more about MythTV in the future. Well I asked my parents to buy me a new one, or actually sent them a link on Newegg to the hard drive I wanted. I had a very foggy idea of how to add a hard drive to a linux box so I looked up some sites I will link to here.

http://linuxplanet.com/linuxplanet/tutorials/4232/4/
http://wiki.linuxquestions.org/wiki/Add_a_new_hard_drive

I mostly used the first walk through, but had to tweak a little with some help from the second site. The issues I found with the first site was it didn't tell me how to mount the hard drive in some other location then /mnt/hdc1, but I replaced that with /recordings which is where I needed my hard drive to be mounted. Also the first site said to use the "default" in your fstab when I needed to use the word "defaults". I am not sure if this change is for everyone or what the deal was there, but everything is working great for my set up and I have tons of room to record all the tv I want.

To sum up adding a hard drive I did this:

ls /dev/hd*
This showed me all the IDE devices that linux was seeing
Then
fdisk /dev/hdd
This started the partitioner for my particular hard drive
Inside of fdisk I used "m" to bring up the menu, "p" to show partitions, "n" for new partition.

Then
mkfs -t ext3 /dev/hdd1
this created the file system for hdd1
Then edit your fstab

I hope this helps you.
Thanks and God bless,
Aaron

No comments: