SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-02-2006, 10:49 PM
mrrrl mrrrl is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Draper, Utah
Posts: 133
Adding Harddrive to an exsiting install

I am running SageTV on a 20 GB drive. I have a 250 GB harddrive that I would like to add to the system. How do I go about formating and getting it ready to accept video. I want to use the 20 GB for the OS and the 250 GB for video.

TIA
Reply With Quote
  #2  
Old 04-02-2006, 11:33 PM
Menehune's Avatar
Menehune Menehune is offline
Sage Aficionado
 
Join Date: Oct 2004
Location: Maui, Hawaii
Posts: 403
Are you adding a Sata or IDE drive? If you are adding an IDE drive, you may need to strap the drives correctly.

Once the drive is recognised in BIOS, in windows XP go into
start>administrative tools>computer management> Disk Management
select the new 250G drive.
right click> format.
select NTFS and 64k allocation size.

Go eat dinner. Come back and your drive will be formatted.

In Sage, go into Setup>detailed>general.
Click video directories "modify".
"Add New directory".
"Change to new directory-specify". Type in the new drive's letter that windows assigned it.
In setup>system information, you should now see the new amount of space available for recording.
Reply With Quote
  #3  
Old 04-03-2006, 06:39 AM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
Quote:
Originally Posted by Menehune
Are you adding a Sata or IDE drive? If you are adding an IDE drive, you may need to strap the drives correctly.

Once the drive is recognised in BIOS, in windows XP go into
start>administrative tools>computer management> Disk Management
select the new 250G drive.
right click> format.
select NTFS and 64k allocation size.

Go eat dinner. Come back and your drive will be formatted.

In Sage, go into Setup>detailed>general.
Click video directories "modify".
"Add New directory".
"Change to new directory-specify". Type in the new drive's letter that windows assigned it.
In setup>system information, you should now see the new amount of space available for recording.
I'm pretty sure it's going to be a little different here in the Linux thread.



Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #4  
Old 04-03-2006, 07:19 AM
mrrrl mrrrl is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Draper, Utah
Posts: 133
Yea, windows is pretty easy and straight forward, I am just not sure on how to do it in the Linux version of SageTV.
Reply With Quote
  #5  
Old 04-03-2006, 08:30 AM
Arawak's Avatar
Arawak Arawak is offline
Sage User
 
Join Date: Mar 2006
Location: London Ontario, Canada
Posts: 30
Essentially, you need to format the hard drive and mount it.

First, you have to identify which device is the new hard drive. This will be different depending on whether you have a SATA or IDE drive.

From the command prompt, issue the command

dmesg | less

This will show you what the kernel discovered about your system when it booted. You'll have to look through it for the section where it talks about hard drives. On my laptop (with 1 IDE drive) this looks like

Quote:
ICH3M: chipset revision 2
ICH3M: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xbfa0-0xbfa7, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xbfa8-0xbfaf, BIOS settings: hdc:pio, hdd:pio
Probing IDE interface ide0...
input: AT Raw Set 2 keyboard as /class/input/input0
hda: TOSHIBA MK6021GAS, ATA DISK drive
input: ImPS/2 Generic Wheel Mouse as /class/input/input1
hdb: TOSHIBA DVD-ROM SD-R6012, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
Probing IDE interface ide1...
hda: max request size: 128KiB
hda: 117210240 sectors (60011 MB), CHS=65535/16/63, UDMA(100)
hda: cache flushes supported
hda: hda1 hda2 hda3
hdb: ATAPI 24X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
My main hard drive is hda, which is the first IDE drive. If you have an IDE system, and you are adding a second IDE drive, then your new one will NOT be hda it will be hdb, hdc, or maybe hdd.

If you are running a SATA system (actually, if your first drive is 20G then I guess it must be IDE) then you drives will be named like sda, sdb, sdc, etc.

So, assuming that you new drive is hdd (slave on secondary channel), you first need to partition it.

fdisk /dev/hdd (replace hdd with whatever your new drive is)

It will give you somehting like this:

Quote:
The number of cylinders for this disk is set to 7296.
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)

Command (m for help):
Press p to see your partition table. Since this is a new, unpartitioned drive, you should not see any partitions.

First, you'll want to add a partition. As the promt says, m will get you a menu of the command fdisk understands. Press n to create a new partition, and follow the prompts to create a new primary partition, accepting the defaults so that it is to full 250 gigs. When you're done, w will write the partition table and exit.

You now have a partition named something like /dev/hdd1

Now, we need to format your new drive. Linux supports a variety of filesystems, so you have some choice here. Sage has decided to use ext3, which IMO is an odd choice because it is one of the slowest filesystems. I'd choose XFS or Reiser myself, but you should probably stick with their choice.

mke2fs -j /dev/hdd1 (again, use whatever your drive is instead of hdd)

After an eternity (ext3 is even slow when formatting) you should have a brand shiny new formatted partition.

Now, you'll need a place to mount this filesystem. /var/media seems to be a logical place, since Sage appears to keep all their data there. However, you'll probably already have stuff there, so we'll need to copy it.

Create a temporary mountpoint:

mkdir /mnt/tmp

and mount the new filesystem there:

mount /dev/hdd1 /mnt/tmp

Now, Sage doesn't seem to have any graceful way to shut it down, so issue this command to kill it the hard way, so it doesn't try to do stuff while we're working:

killall java

That should kill the SageTV process, unless they've got it set to respawn it which case... well... just make sure nothing is recording while you're trying to do this.

Okay, now we will move everything under /var/media to your new drive.

mv /var/media/* /mnt/tmp

Hopefully you won't get any errors about files being in use.

Now, we detach the partion from the temporary mountpoint

umount /mnt/tmp

and re-attach it to where we want it. In order to do this so that it will 'stick', we need to update the /etc/fstab file

nano -w /etc/fstab

Add this line to that file:

Quote:
/dev/hdd1 /var/media ext3 noatime 0 1
(ctrl-x to exit)

Mount the partition

mount /var/media (it will look at the file we just modified to figure which partition to mount there)

The easiest way to get Sage back up is probably to reboot:

reboot (this is probably the only UNIX command there is that doesn't make you go "huh?" :-) )

Quote:
DISCLAIMER:
This is not rocket science, but it is kind of technical. All these commands are executed as root so you can easily demolish your installation if you are not careful or if either of us has made an error. I'm writing this off the top of my head, so there could be little gotchas. If you are a total linux/UNIX newbie you might want a friend with some linux experience to walk through this with you.
SageTv's choice to use Gentoo for a Linux OEM is a brilliant one, since it is ideally suited to the kinds of customisations that a Vendor might want to do, but Gentoo is not targetted at new Linux users. It's very much a technically-oriented distro.

It is however, probably the best documented and supported by its community. It's an excellent distribution on which to learn Linux (and here I mean a Linux-based OS, not merely a desktop like KDE or Gnome). I highly recommend the Gentoo Wiki and the Gentoo Community forums for research on your Linux Sage box.

Cheers,

Arawak
Reply With Quote
  #6  
Old 04-03-2006, 08:31 AM
mrrrl mrrrl is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Draper, Utah
Posts: 133
Ok does this sound correct. I got this info from various places.

When Linux boots you need to find the new drive and make sure that the bios and linux sees it and it is correct and what device it is labeled as (i.e. hdd). Use “dmesg | more” to see the boot log.

Use "fdisk /dev/hdd" to edit the partition table on the disk. Create a new primary partition (hdd1) and set the size to be the whole disk, then write the changes to disk and exit.

Now format the partition as ext3 using:

# /sbin/mkfs.ext3 -m 0 -j /dev/hdd1

The -m 0 tells the format program to not reserve any space for root, and the -j creates an ext3 journal.

Now create a mount point and mount the partition:

# mkdir /mnt/hdd1
# mount /dev/hdd1 /mnt/hdd1

Use this to check it out:

# ls -l /mnt/hdd1

Finally add an entry to the /etc/fstab file to mount the partition when your machine boots:

/dev/hdd1 /mnt/hdd1 ext3 defaults 1 2

I would then make a new dir on the drive (i.e. video) to store the video files in. Then make the changes in SageTV to point to the new drive and video directory.
Reply With Quote
  #7  
Old 04-03-2006, 11:00 AM
mrrrl mrrrl is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Draper, Utah
Posts: 133
Thanks Arawak, your post is great and has a great deal of info. Looks like we posted about the same time. I will give it a try tonight.
Reply With Quote
  #8  
Old 04-03-2006, 04:43 PM
mrrrl mrrrl is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Draper, Utah
Posts: 133
Well I got the drive formatted and it mounts in /mnt/hdb1 after rebooting, but when I go to Detailed Setup - General - Video Recording Dir, it does not show up. I can go from /var/media to /var and see all the folders there, then go up one more dir to /, but nothing shows up. So I can't get to /mnt to get to hdb1.

Any ideas?

TIA
Reply With Quote
  #9  
Old 04-03-2006, 05:54 PM
Menehune's Avatar
Menehune Menehune is offline
Sage Aficionado
 
Join Date: Oct 2004
Location: Maui, Hawaii
Posts: 403
Quote:
Originally Posted by gplasky
I'm pretty sure it's going to be a little different here in the Linux thread.



Gerry

Open mouth, insert foot.

I could've sworn I checked to see if it was a linux or windows thread.
Reply With Quote
  #10  
Old 04-03-2006, 07:10 PM
AndyS AndyS is offline
Sage Aficionado
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 383
Quote:
Originally Posted by mrrrl
Well I got the drive formatted and it mounts in /mnt/hdb1 after rebooting, but when I go to Detailed Setup - General - Video Recording Dir, it does not show up. I can go from /var/media to /var and see all the folders there, then go up one more dir to /, but nothing shows up. So I can't get to /mnt to get to hdb1.

Any ideas?

TIA
If you followed Arawak's instructions you mounted the new filesystem at /var/media so that's what you'd see when you look at /var/media. Try a df -k . (don't forget the period at the end!) in /var/media and see what device it reports back.

If you look in the OS where are all your media files?

Andy.
Reply With Quote
  #11  
Old 04-03-2006, 07:36 PM
mrrrl mrrrl is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Draper, Utah
Posts: 133
OK, I went back and changed fstab:

/dev/hda1 / ext3 noatime 0 1
/dev/hda3 /var/media ext3 noatime 0 2
/dev/hda2 none swap sw 0 0
/dev/hdb1 /var/media ext3 noatime 0 1
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0

Rebooted the machine.

STVMC-272 / # cd /var/media
STVMC-272 media # ls
lost+found music pictures tv videos
STVMC-272 media # df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 240362656 3420524 236942132 2% /var/media

This reports the main drive (20GB) hda3.

So I went to /mnt.

STVMC-272 media # cd /mnt
STVMC-272 mnt # ls
cdrom floppy hdb1 tmp
STVMC-272 mnt # cd hdb1
STVMC-272 hdb1 # ls
STVMC-272 hdb1 # df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 3199216 1716756 1319948 57% /

And it show again hda1 the main 20GB, but shows 57% used, which would be close with Gentoo and SageTV loaded.

So I am a bit confused on this one.
Reply With Quote
  #12  
Old 04-03-2006, 08:28 PM
AndyS AndyS is offline
Sage Aficionado
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 383
You have the /var/media mountpoint specified twice in /etc/fstab. Comment out the line that mentioned /dev/hda3. Then do a umount -a (don't worry about any device-busy error messages) followed by a mount -a and report back to us.

Andy.
Reply With Quote
  #13  
Old 04-03-2006, 08:50 PM
mrrrl mrrrl is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Draper, Utah
Posts: 133
OK, I was wondering about. So I did as you say. Had to reboot. But everything looks good.

STVMC-272 media # df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdb1 240362656 5787044 234575612 3% /var/media

Thanks for all your help.
Reply With Quote
  #14  
Old 04-03-2006, 08:54 PM
AndyS AndyS is offline
Sage Aficionado
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 383
No problem. FYI, if you do a 'df -m' instead you get allocated and freespace in megabytes. It's a little easier to read than kilobytes.

Andy.
Reply With Quote
  #15  
Old 04-04-2006, 01:10 PM
stevech stevech is offline
Sage Icon
 
Join Date: Dec 2005
Posts: 1,643
Oh my. just look at the long sequence of shell commands to do such a simple thing.
Reply With Quote
  #16  
Old 04-04-2006, 01:26 PM
AndyS AndyS is offline
Sage Aficionado
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 383
Quote:
Originally Posted by stevech
Oh my. just look at the long sequence of shell commands to do such a simple thing.
Hehe.

Well, it works both ways. Unix is low-level (hence the numerous commands above) but can be very terse in its syntax. So you could (for instance) look for all the files with a '.mpg' extension in a particular filesystem and perform an operation on them and then move them to a different location with a different name all on one single line. Try that in Windows!

Andy.
Reply With Quote
  #17  
Old 05-30-2006, 10:39 AM
cbhatt cbhatt is offline
Sage User
 
Join Date: Jan 2006
Location: Mount Laurel, NJ
Posts: 20
what about hda3?

Hi all,
Let's say I add a second (larger) HD (/dev/hdb) to my sage system and move /var/media as described, what happens to the old /var/media mounted on /dev/hda3? Anyway to reclaim the space and give it to /dev/hda1 (the / filesystem)? Thanks.
__________________
-Chirag
Reply With Quote
  #18  
Old 05-30-2006, 01:17 PM
MrD MrD is offline
Sage Aficionado
 
Join Date: Feb 2005
Location: Washington DC
Posts: 387
It would be much better to use LVM and add the disk to a physical volume / logical volume.

That way Sage configuration would not need to change. Well maybe initially it would change, but after the initial adoption of the LVM setup it would essentially never need to change.

-MrD
Reply With Quote
  #19  
Old 05-30-2006, 01:22 PM
zoop's Avatar
zoop zoop is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Elkridge, MD
Posts: 184
Quote:
Originally Posted by cbhatt
Hi all,
Let's say I add a second (larger) HD (/dev/hdb) to my sage system and move /var/media as described, what happens to the old /var/media mounted on /dev/hda3? Anyway to reclaim the space and give it to /dev/hda1 (the / filesystem)? Thanks.
you will need to delete the /dev/hda3 partition with fdisk and then use a resizing utility such as partd to extend the /dev/hda1 partition. follow the FAQ for the procedure to extend the size of /dev/hda1
http://www.gnu.org/software/parted/parted.html/

Last edited by zoop; 05-30-2006 at 01:38 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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 On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 03:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.