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

Removable Drive and Myth Media
http://forum.linhes.org/viewtopic.php?f=11&t=11523
Page 1 of 1

Author:  beilber [ Sat Sep 09, 2006 10:21 pm ]
Post subject:  Removable Drive and Myth Media

Hey All this is my first post. I currently have Knoppmyth installed and running like a champ. I am currently attempting to get my 500GB eSata drive to function with myth. First a little background:

1. The Drive currently has 2 NTFS partitions, for administration on my M$ box.
2. The Drive uses a Sata Interface and is detected as /dev/sdb
3. I am able to mount and access the files systems outside of myth.

Currently mounted as:
Code:
 /dev/sdb1/ on /mnt/ext type ntfs (rw)


The Folders on sdb1 are as follows:

Video
Pictures
Music

What I am trying to do is have a seamless intergration with MythTv so that when it looks for Videos lets say, that all data from /mnt/ext/Video shows up in Myth as if it were in the /myth/video folder. Same for Pictures and Music.

I am messing with Symbolic Links now and here are the ones i am going to mess with:
Code:
 ln -s /mnt/ext/ /myth/video
 ln -s /mnt/ext/ /myth/music
 ln -s /mnt/ext/ /myth/gallery


Inside of each folder, for example /myth/video, i see the SL for ext and i am able to browse it from trminal window, but i cannot see it within myth

Any feed back would be appreciated! :D

Author:  mjl [ Sun Sep 10, 2006 7:17 pm ]
Post subject: 

Hi,
If you check around I think you will find there is potential issues with ntfs and linux. Linux can read it ok however there stands a potential for damage / corruption if linux does write to ntfs. Maybe that has improved recently, don't know, don't care as I only use M$ at work when I have to so those worlds rarely meet for me even though I dual boot my laptop.

If you need to have an area common, reformat one of the partions as fat 32 or something that both worlds can live with. The only reason myth is not seeing the files that you can see manually is that you would need to go through the setups to tell myth that your music files are on /mnt/ext/blah/blah/&blah. Of course to have them accessable, they need to be mounted.

You could umount /myth & disable it or set the myth mount point to be elsewhere. Then you could then mount /mnt/ext/blah /myth

Mike

Author:  spalVl [ Sun Sep 10, 2006 8:44 pm ]
Post subject: 

I had some weirdness too with mounting external drives. It worked but wasn't showing the directory contents, however changing to directories worked. I had a 1.1 USB external with FAT32. I used autofs to mount. Here are my notes.

Quote:
My USB drive is /dev/sda1 (obtained though dmesg)

/etc/auto.master
---------------
/mnt/usb /etc/auto.usb.mnt --timeout=2
---------------


/etc/auto.usb.mnt
-----------------
sda1 -fstype=vfat,uid=1002,gid=1002,umask=002,noatime :/dev/sda1
---------------

Then I create a symlink to usb drive in video, music, gallery, storage locations.

ln -s /mnt/usb/sda1/video /myth/video/sda1
ln -s /mnt/usb/sda1/music /myth/music/sda1
ln -s /mnt/usb/sda1/gallery /myth/gallery/sda1


Weird thing is when mounting the drive though autofs ls command shows /mnt/usb as empty. But I can cd into /mnt/usb/sda1 and the symlink command works fine.


Here is a quick/dirty script I used to setup the drive.

Code:
#Add Samba and USB mount commands to /etc/auto.master
echo "/mnt/usb /etc/auto.usb.mnt --timeout=2">>/etc/auto.master

#Add command to mount USB /etc/auto.usb.mnt
echo "sda1 -fstype=vfat,uid=1002,gid=1002,umask=002,noatime :/dev/sda1">>/etc/auto.usb.mnt

#Stop & Start autofs
/etc/init.d/autofs stop
/etc/init.d/autofs start

#Create links in appropiate directory for usb drive
ln -s /mnt/usb/sda1/video /myth/video/sda1
ln -s /mnt/usb/sda1/music /myth/music/sda1
ln -s /mnt/usb/sda1/gallery /myth/gallery/sda1


Little easter egg, create a picture named folder.jpg in /mnt/usb/sdaX/video and when in gallery mode with folders in MythVideo will show thumbnail of folder.jpg browsing.

Author:  beilber [ Sun Sep 10, 2006 9:43 pm ]
Post subject: 

thanks for the info guys, right now the drive isn't usb external its actully physicaly attached to the SATA interface. I am going to backup the data and repartition to FAT32 at work tomorrow, I would rather have compatability over, well M$ crap....

If i mount /dev/sdb1 to /myth, If i do not have the drive connected how would Myth function? My internal Drive is a 80GB (/dev/sda1) and that is always connected. I wanted it to be that when the external is connected that all its data (music, pictures, videos) would be directly readable in
myth and when its disconnected have it use the internal drives partition.

Know any way to do that?

I think that made sense but who knows its past my bed time :mrgreen:

Author:  mjl [ Sun Sep 10, 2006 10:45 pm ]
Post subject: 

Hi,

You may need to make it a menu item so switch it on / off line. I have not had a chance to see what spalVl is doing with his scripts and that may be sort of what he is doing. If you don't have the autousb working, KM gets unhappy trying to find the missing drive if it in the fstab to be mount at boot time.

You can't just umount /myth then pop in an external ... backend is running and needs it, also will confuse the mysql a little. Making an additional level in ~/myth/music/ext (example) then you could have it mount / unmount into that level and should be good.

As for redoing the ext drive, Ubuntu 6.06.1 gives you the tools to "resize" and then make & format new partitions. It is a "live" cd so you don't even need to install it

You are going down a learning path so keep smiling :)
Mike

Author:  spalVl [ Mon Sep 11, 2006 5:03 am ]
Post subject: 

Quote:
Know any way to do that?


You should be able to use my script from above. Replace /dev/sda1 with /dev/sdb1 or whatever partition you end up using. Or if you don't want to use autofs use a fstab entry and mount -a command.

With the symbolic link if the drive is not present Myth plugins simply won't read those directories.

I use MythVideo extensivley for this and works great, only downside is when going in Video Manager if/when symlink location is not available prompts to remove videos because cannot find. Not sure how nicely MythMusic and MythGallery behave.

Author:  mjl [ Mon Sep 11, 2006 6:15 am ]
Post subject: 

Hi,

Thanks spalVl ,

I am going to have to try your scripts myself :) Been doing it the hardway mounting - unmounting.

MythMusic will get "mad" if you try to play things that don't exist. Gallery appears to pick up and drop upon entry. None complain until trying to be accessed.

Mike

Author:  beilber [ Mon Sep 11, 2006 7:44 am ]
Post subject: 

Thanks again for in info Guys!

When I get home from work I will give it a try SpalVl, I see why it isn't working atleast. The external Drive enclosure I am using has usb 2.0 and Sata interfaces so I may just use the usb then it it should be eaisier to work with for now. I only used the Sata for the throughput but at this point I am not viewing any media that requires SATA speed.

Since I am still a Linux noobie in a few aspects :D I just have 1 More question.

If I were to mount /dev/sdb1/music to /myth/music/ext, I would have to do a mkdir /myth/music/ext first? then after mounting it should be browseable in myth? Thanks in advance

Author:  spalVl [ Mon Sep 11, 2006 11:47 am ]
Post subject: 

Quote:
I would have to do a mkdir /myth/music/ext first? then after mounting it should be browseable in myth?

No you won't have to make a directory. ln -s creates a symbolic link, it is kind of like a shortcut in Windows but smarter, you can cd into a symlink etc.

Author:  beilber [ Mon Sep 11, 2006 10:05 pm ]
Post subject: 

Ok, Here is where I'm at

Like before I tried the sym links that spalVl told me to try and like before I am able to browse the files system from the shell. But I still can't get the Frontend to see them

Code:
 ln -s /mnt/sdb1/Video /myth/video/


for now I am just going to focus on the the Video folder until it works then move on to the rest.....

I was reading a few posts and wondered if it was a permission issue since I su at the shell and have been performing these actions as root. I tries to cd /mnt/sdb1 logged in as mythtv and got the following response
Quote:
-sh: cd: /mnt/sdb1/: Permission denied


:oops:
the first word out of my mouth was Eurka! The only problem is I am not familar with setting up user permissions. I am hoping that this is the problem and that once I fix the Perm. issue I should be able to do the sym links as mythtv.

Would any of you fine people car to help?

Author:  spalVl [ Tue Sep 12, 2006 5:08 am ]
Post subject: 

Should have mentioned this a while ago, but is a now a script in KM to setup external drives although unsure if works with SATA. /usr/local/bin/setup_usb.sh

1st off your ln command is wrong. It won't be able to create a video symlink b/c /myth/video exists.

Code:
ln -s /mnt/sdb1/Video /myth/video/sdb1


2nd I don't know exactly the command to mount in your scenario (running late have to run to work), but the "uid=1002,gid=1002" options set the permissions for the mount 1002 is the MythTV user and group. Try adding those to your existing mount command.

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