Author |
Message |
tophee
|
Posted: Tue Apr 08, 2008 5:14 am |
|
Joined: Tue Sep 13, 2005 10:48 am
Posts: 852
Location:
London, UK
|
Hi,
This is probably a relatively easy job, but before I get started I am aiming to measure twice and cut once. So I don't hose the system.
AIMS:
1. To add a second SATA drive to my current system (R5F27)
2. Move content across from the current /myth/video to the second harddrive.
The intention is to leave /myth/tv on the first harddrive and have the second harddrive for video.
1. Adding the hard drive and formatting it:
(Check the OS has seen it!) Code: ls /dev/sd* Format with fdisk and follow instructions so /dev/sdb becomes /dev/sdb1 Code: fdisk /dev/sdb Build file system Code: mkfs -t XFS /dev/sdb1 Set it to automount: Code: fsck -f -y /dev/sdb1 2. Copying the contents of /myth/video over to sdb1. (Here is where I get a bit wobbly) So do I just do a Code: cp -Rav /dev/sda3/myth/video /dev/sdb1/myth/video Or would it be a case of Code: cp -Rav /dev/sda3/myth/video /dev/sdb1/video and change where myth is expecting videos to be i.e. /dev/sdb1/video?
I should make it clear that this is all based on internet research and no "real" Linux knowledge. (Monkey see. Monkey do!)
Thanks for looking and in advance being told "No, you do it like this."
Regards
Chris
_________________ Version:R8 Intel C2D 7400, Nvidia 5600 via HDMI to Samsung B37B650TW (PAL), Asus P5QL-E mobo, 4Gb PC6400 DDR2 ram, Samsung Spinpoint 500 Gb & 1Tb drive, Nova-HD-S2 (x2)
|
|
Top |
|
|
mjl
|
Posted: Tue Apr 08, 2008 6:29 am |
|
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location:
Warwick, RI
|
Hi,
You have a lot of flexibility. The hardest part is having to "gasp", power down to add the drive!
Only thing from my view is where you may have an issue is in the copy steps:
my steps would be:
format the new drive with choice of file system, I have no issues with the ext3 and have used the one liner in Cecil's Pamphlet more than once!
Once formatted:
# mv /myth/video /myth/video1
# mkdir /myth/video
make the fstab to have the mount point for the new drive to be the /myth/video
/dev/sdb1 /myth/video (auto defaults,user,auto 0 2 the usual stuff that follows)
# mount /myth/video (which is now sdb1)
# chown mythtv:mythtv /myth/video
At this point operations should be still normal, your videos would just not be visible to the KM system. To make all as before, is now do the copy
Code: cp -Rav /dev/sda3/myth/video1/* /myth/video/
I am going to assume the cp switches cover everything needed, I normally only do cp -a.
After all is verified that the content is in place, you can delete the original /myth/video1 to recover the space for tv recordings.
Only gotcha is if or when you upgrade, you have to remake the fstab entry to be able to remount the sdb1 onto the /myth/video folder again.
I apt-get gparted and use it to play with my drives.
Just some different perspectives, just be careful as to be sure of where one is at before deleting stuff, I hate oops
Oh gee, if you fill that drive, repeat the process for more content and you can store the full drive in a safe place to have a collection. Sort of the modern day version of a shelf full of vhs tapes, just not as handy to change. Of course there is always usb......
Usual disclaimers go here.
Mike
|
|
Top |
|
|
alien
|
Posted: Tue Apr 08, 2008 7:03 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
Just to prove that there are at least two ways to do anything....
Instead of mounting /dev/sdb1 onto /myth/video, you can create a symbolic link Code: ln -s /mnt/sdb1 /myth/video Replace /mnt/sdb1 with the location of your sdb1 mount.
This has two advantages:
1. It has a greater chance of surviving an upgrade with no intervention if the upgrade uses the same default fstab mount points.
2. No chance of collecting dead files under the mount. If for whatever reason, it doesn't mount, mythtv will write directly to /myth/video on sda3. If the next time the mount works, it will mount on top of the files and hide them. It makes debugging filesystem full problems really fun
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
|
mjl
|
Posted: Tue Apr 08, 2008 8:00 am |
|
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location:
Warwick, RI
|
Thanks alien!
I like the link tip
Mike
|
|
Top |
|
|
alien
|
Posted: Tue Apr 08, 2008 9:01 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
mjl wrote: Thanks alien! I like the link tip Mike
np
Although I expect the "mounters" would have a list of their advantages.
One I can think of is that the "mount" command provides a nice summary of what is mounted where. There is no equivalent for links. If one is not careful, one can create a tangled mess with links.
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
|
tophee
|
Posted: Tue Apr 08, 2008 9:27 am |
|
Joined: Tue Sep 13, 2005 10:48 am
Posts: 852
Location:
London, UK
|
Thanks for the replys.
mjl - yeah, perhaps there should have been a "0. Turn Mythbox off" line at the top. Appreciate being corrected on the how to copy stuff over.
Apparently the -Rav switch ensures permissions are copied over too. As I say, my understanding of linux is only book learnt and limited practical experience (only when I've had to do something.)
If I read it correct the -Rav switch copies all the permissions too.
alien - I quite like the sound of the symbolic link approach. And if I am reading this right... (quick look via google) ... means that I can format and copy everything to /dev/sdb1 as above and then create the symbolic link so myth will look at the /myth/video on /dev/sda1?
No fiddling with fstab!
I'll have a go and let you know how I get on. Thanks
edit ... now you say its better with mounts... grr....
_________________ Version:R8 Intel C2D 7400, Nvidia 5600 via HDMI to Samsung B37B650TW (PAL), Asus P5QL-E mobo, 4Gb PC6400 DDR2 ram, Samsung Spinpoint 500 Gb & 1Tb drive, Nova-HD-S2 (x2)
|
|
Top |
|
|
alien
|
Posted: Tue Apr 08, 2008 9:36 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
tophee wrote: alien - I quite like the sound of the symbolic link approach. And if I am reading this right... (quick look via google) ... means that I can format and copy everything to /dev/sdb1 as above and then create the symbolic link so myth will look at the /myth/video on /dev/sda1? No fiddling with fstab! Note: One step has sort of been skipped over. You cannot access files in /dev/sdb1 directly. This has to be mounted somwhere. If the drive was there when knoppmyth was installed, it is probably already mounted in /mnt/sdb1 (I think). If you have the automounter working properly, it may be in /media/sdb1. If it isn't anywhere, then you need to add in an entry in fstab.
The quickest way to find out is to issue the "mount" command.
As for my comment that there are potential advantages to mount: Just to clarify. I have used both and prefer using links. They are just easier to maintain in my opinion. Just don't get complicated with it. One link per drive should be enough. More than that and you will start to lose track of what's linked where.
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
|
tophee
|
Posted: Tue Apr 08, 2008 9:50 am |
|
Joined: Tue Sep 13, 2005 10:48 am
Posts: 852
Location:
London, UK
|
Hi alien, thanks for replying (again).
I see, I think. Unfortunately, I can't get to my mythbox right now, but I think I follow.
Is this more than making an entry in fstab to tell myth that the drive is there?
Unlike mike said:
Quote: /dev/sdb1 /myth/video (auto defaults,user,auto 0 2 the usual stuff that follows) which is mounting the second drive at /myth/video?
_________________ Version:R8 Intel C2D 7400, Nvidia 5600 via HDMI to Samsung B37B650TW (PAL), Asus P5QL-E mobo, 4Gb PC6400 DDR2 ram, Samsung Spinpoint 500 Gb & 1Tb drive, Nova-HD-S2 (x2)
|
|
Top |
|
|
mjl
|
Posted: Tue Apr 08, 2008 1:34 pm |
|
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location:
Warwick, RI
|
Hi,
From my view, I try to keep things simple and self recovering if something happens.
As was pointed out, storage devices, cdrom, dvd, floppy, tape hard drives all require a place to call "home" In Linux talk, that is a "mount point"
When you add a drive it just sits there using power. You need to format it so things can be written & read in an orderly manner thus becoming useful.
Now you can make a home for it where ever you wish but the common areas are as was mentioned, /mnt or /media. Since the whole system looks to the /myth/video to find content and you wish to still have your video content only in a larger container, it is most logical for me to put it back as /myth/video as it's home.
If you simply "mount" your newly setup drive on /myth/video, then all of your content becomes hidden under the blank space of the new drive. So, I had sugessted "moving" the current /myth/video to become /myth/video1 This leaves a hole and you can make a NEW /myth/video folder which is also a"mount point" . IF you do not mount a drive onto /myth/video the systems runs as normal. IF you mount the new drive onto /myth/video then the system still runs normal only now has the new storage space to use for content.
The fstab is required in any situation.
Mike
|
|
Top |
|
|
knappster
|
Posted: Tue Apr 08, 2008 2:28 pm |
|
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
|
I am by no means an expert, but if I was to do this, I would go with Mike's advice. You have to mount the drive with fstab anyway, so why mess with the link? It is messier and adds another step.
It seems to me that you could take advantage of space from both drives if you were to mount the new hard drive within the video directory instead of as the video directory. In my case, all of my transcoded videos go to:
/myth/video/archive
So I would probably use Mike's method with the /myth/video/archive directory instead of/myth/video. Then I could put other videos on the original hard drive in the /myth/video directory or any directories that I create within it.
Of course I fully expect these guys to correct me if I have said anything inaccurate.
|
|
Top |
|
|
tjc
|
Posted: Tue Apr 08, 2008 5:53 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
tophee wrote: Build file system Code: mkfs -t XFS /dev/sdb1
You probably want to use the same type of "small number of large files" options here you would for EXT3. The options are not identical but the the same principles apply...
- Large block sizes
- Low inode counts
- ...
|
|
Top |
|
|
goofnrox
|
Posted: Tue Apr 08, 2008 10:08 pm |
|
Joined: Mon Apr 17, 2006 2:52 pm
Posts: 31
Location:
Michigan
|
mjl wrote: Hi,
You have a lot of flexibility. The hardest part is having to "gasp", power down to add the drive!
Mike
Not to be a smarty pants, but SATA is hot swapable, so no power down needed ;P.
_________________ Increasing my couch potatoness by a factor of pie.
|
|
Top |
|
|
tophee
|
Posted: Wed Apr 09, 2008 3:18 am |
|
Joined: Tue Sep 13, 2005 10:48 am
Posts: 852
Location:
London, UK
|
After reading through again the posts above (thanks everybody!) I think I now follow what people were telling me. Sorry for being a bit slow on the uptake
So, as I understand it I either mount my new drive under /myth/video as suggested by mike. This seems the most straight forward way of doing this:
1. Install hard drive (probably by turning the myth box off first ), format and mount, chown, edit fstab etc. (as above)
2. Rename/copy /myth/video to /myth/video1 (or similar)
3. mkdir /myth/video on sdb1 and cp -a /dev/sda3/myth/video1/* /myth/video/
4. Delete /myth/video1
5. Reboot. (Is it necessary?)
Or I follow Alien suggestion of making a symbolic link from /myth/video to sdb1 which has to be mounted somewhere such as /mnt/sdb1.
Under alien's suggestion after I had mounted and formatted sdb1 I would:
1. Copy everything over from /myht/video to sdb1.
(Is a destination folder necessary for this?)
2. Delete /myth/video
3. Create a symbolic link from /myth/video to it using ln -s /mnt/sdb1 /myth/video.
My initial thoughts were closer to Mike's suggestion. However there are some benefits to alien's such as upgradeability. However, I think this time I'll go with the first suggestion.
Oh, tjc - I think I see what you were getting at... the -t switch is incorrect. Looking at the filesystem swith page on the wiki, they suggest for XFS usinf the -f switch... Something like this:
Code: mkfs.xfs -f /dev/sdb1
I think. Regards.
_________________ Version:R8 Intel C2D 7400, Nvidia 5600 via HDMI to Samsung B37B650TW (PAL), Asus P5QL-E mobo, 4Gb PC6400 DDR2 ram, Samsung Spinpoint 500 Gb & 1Tb drive, Nova-HD-S2 (x2)
|
|
Top |
|
|
mjl
|
Posted: Wed Apr 09, 2008 5:35 am |
|
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location:
Warwick, RI
|
Hi,
Looks pretty close. Be advised that it is totally unwise to delete anything until you are absolutely sure everything is in the proper location. There is no haste needed to delete /myth/video1 until you are ready for the space.
It not very often a reboot is required, changes to the kernel, changes to some drivers for the supported hardware things along those lines.
I am old school, so when it comes to putting in boards, drives, cables & etc, I will error on the side of caution and shut down for safety first. (Safety of the system) Once it has been setup and wired in, then yes, the sata can be hot swapped. Nothing I run is that "mission critical" so I shut it down
cp -a /myth/video1/* /myth/video/
the /dev/sda3 part is covered in the fstab.
To do the mv to change the name, it is a simple pointer that changes just the name and no actual content is disturbed.
Mike
|
|
Top |
|
|
tjc
|
Posted: Wed Apr 09, 2008 7:10 am |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
tophee wrote: Oh, tjc - I think I see what you were getting at... the -t switch is incorrect. Looking at the filesystem swith page on the wiki, they suggest for XFS usinf the -f switch... Something like this: Code: mkfs.xfs -f /dev/sdb1
Not quite. See the on-line man pages for mkfs.xfs, say here: http://linux.die.net/man/8/mkfs.xfs you want options like -b to set a large block size (search for recommendations) and -i to reduce the number of inodes.
|
|
Top |
|
|