LinHES Forums
http://forums.linhes.org/

Adding Second Hard Drive
http://forums.linhes.org/viewtopic.php?f=1&t=641
Page 2 of 2

Author:  Xsecrets [ Fri Nov 19, 2004 12:14 am ]
Post subject: 

no because mythtv only allows one place to look for stuff, although lvm as mentioned above will allow you to make a larger myth partition virtually speaking.

Author:  tjc [ Fri Nov 19, 2004 12:48 am ]
Post subject: 

No. Computers do not cope well with Larry, Daryl and Daryl type ambiguity. You have a couple options.

1) Mount the new drive on /mth/tv rather than myth, this lets you use the space in the old partition for other stuff like music, videos, ... (search clue "mount" "second" "drive" and DON'T FORGET TO USE THE "require all terms" BUTTON)! If you're clever you can write script like this to let you shuffle stuff into that space and leave a symlink behind:
Code:
#!/bin/sh

for i in "$@" ; do
    fname=`basename "$i"`
    old_file="/myth/tv/$fname"
    new_file="/myth/video/$fname"
    if [ -L "$old_file" ] ; then
        echo "File '$old_file' is already a symlink!"
    elif [ -e "$new_file" ] ; then
        echo "File '$new_file' already exists!"
    else
        echo "moving '$fname' from /myth/tv/ to /myth/video/"
        mv "$old_file" /myth/video/
        ln -s "$new_file" "$old_file"
    fi
done
Moving the file back or cleaning it up when the front end removes the symlink is left as an exercise for the student.

2) Use LVM (aka Logical Volume Manager - thats a search clue BTW)

Author:  cesman [ Fri Nov 19, 2004 1:32 am ]
Post subject: 

tjc wrote:
Larry, Daryl and Daryl
LOL!

Author:  khrusher [ Fri Nov 19, 2004 11:05 am ]
Post subject: 

I did as TJC did...mount the new larger drive are /myth/tv (via LVM). I wanted to have all the data from tv and video on the large drive.

I created a /myth/tv/video directory and a symlink ffrom /myth/video to /myth/tv/video.

So I can access the video files via /myth/video while they are on the large disk mounted at /myth/tv

Its a little convoluted, but has worked well for me

Code:
root@mythtv:/myth # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1              2679960   2145868    398348  85% /
/dev/root.old             2182       342      1840  16% /initrd
/dev/hda3              6304860      6448   6298412   1% /cache
/dev/hda4             68494572  15007764  53486808  22% /myth
/dev/vg/mythdata     244131052 163756472  80374580  68% /myth/tv
root@mythtv:/myth # ls -l /myth/video
lrwxrwxrwx    1 mythtv   mythtv         14 Jun 11 08:12 /myth/video -> /myth/tv/video

Author:  Xsecrets [ Fri Nov 19, 2004 10:59 pm ]
Post subject: 

This may be a stupid question, but if you are going to use lvm why mount it at /myth/tv instead of just /myth ?

Author:  tjc [ Sat Nov 20, 2004 12:07 am ]
Post subject: 

Sorry if it wasn't clear, but the two options were meant as an "either 1 or 2" rather than a "both 1 and 2"...

Author:  khrusher [ Sat Nov 20, 2004 6:59 pm ]
Post subject: 

Quote:
This may be a stupid question, but if you are going to use lvm why mount it at /myth/tv instead of just /myth ?


I had a initially set up my mythbox with an 80 GB drive...without LMV. It didnt take long to realize that an additional 250GB would be nice.

I added the second drive w/o rebuilding knoppmyth, so the initial drive is non-LVM.
I mount the big drive ate /myth/tv so I can use the space on the original 80 GB drive. as configured, music and games are hitting the originally created /myth filesystem. TV and repped DVDs to the new disk.

I used LVM for the new disk 1) for the experience and 2) if i aver add another disk, the LVM will make that easy

Author:  Xsecrets [ Sun Nov 21, 2004 1:12 am ]
Post subject: 

yes, but since you went with lvm you could have taken the /myth partion from the original disk and added the entire second disk to that same virtual volume, and had the space for anything stored in the /myth p

Author:  Liv2Cod [ Sun Nov 21, 2004 1:13 am ]
Post subject: 

You don't need to rebuild KnoppMyth to change to LVM if you're adding a drive. See the wiki page about additional hard drive for a short description.

Author:  khrusher [ Sun Nov 21, 2004 8:30 am ]
Post subject: 

gotcha. didnt realize I could pull the original drive into LVM. Maybe a project for a slow weekend

thanx

Author:  neutron68 [ Sat Jul 01, 2006 10:54 pm ]
Post subject:  trying to copy /myth directory

Hi,

I'm trying to add a 500GB IDE hard drive (one big ext3 partition) as a second drive and then map the /myth directory over to it. I'm following the steps from the first posts in this thread and when I get to the part
Code:
cp -p /myth/* /mnt/newdisk

the computer says
Code:
cp : omitting directory '/myth/tv'
cp : omitting directory '/myth/pretty'
cp : omitting directory '/myth/games'
cp : omitting directory '/myth/temp'
cp : omitting directory '/myth/video'

...and so on.

What is going wrong??? This appears to be a very straightforward command, yet it does not work!

Author:  tjc [ Sat Jul 01, 2006 11:52 pm ]
Post subject: 

Use cp -a instead or "cp -p". I suspect that was a typo which was intended as "cp -pR", but "cp -a" is better still. For more details:
Code:
man cp

Author:  neutron68 [ Sun Jul 02, 2006 12:09 am ]
Post subject:  figured out the previous poster's mistake

Thanks for your reply tjc.

I had just figured out that micsaund was totally wrong in their command construction, when I saw your reply. Too bad no one noticed that mistake before now. (according to the man, there is no * as part of the cp command) :x

I followed the usage in the CP man page and used
Code:
cp -p -r /myth/ /mnt/newdisk

and that worked fine.

I see from the man page that a '-a' is equillivant to a '-r -p -d'.

I'm now up and running with a 500GB drive as my /myth partition! Nice. :)

Eric

Author:  tjc [ Sun Jul 02, 2006 12:27 am ]
Post subject: 

There was a reason for using the *, it was to avoid ending up with "/myth/myth" when you remounted the new disk as "/myth". Thus you copy everything from the old /myth directory to the partition that's going to become the new /myth.
Code:
cp -a /myth/* /mnt/newdisk

Author:  neutron68 [ Sun Jul 02, 2006 11:22 am ]
Post subject:  use "-r", not *

tjc wrote:
There was a reason for using the *, it was to avoid ending up with "/myth/myth" when you remounted the new disk as "/myth". Thus you copy everything from the old /myth directory to the partition that's going to become the new /myth.


Odd...There is absolutely no mention of using a * with the CP command in the man pages, so I've got no idea where you pulled that from?

The man page says to use '-r' to copy the directory and all it's subdirectories. So, I used "-r" rather than a * and the copy process worked just fine. It worked, so it must be right. :)

Contrary to speculation, I've got no double /myth/myth directory. My /dev/hdb1 partiiton is properly mapped as /myth and filled with my video files, etc. Right on.

Eric

Page 2 of 2 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/