Jump to content

How do I mirror cache drive's contents to a new disk?


johnny121b

Recommended Posts

I'd like to upgrade my cache drive, but I need to KEEP the drive's current files + directory structure (it hosts PLEX).  I'm using a TAMS server (so I have open drive bays.)  It seems that the directory structure PLEX created ISN'T Windows compatible (255+ characters)...so simply copying across my network to the drive via my Windows machine is a no-go.

I'd like to

 

Plug new drive in

Mirror contents of cache drive to it

Stop the array

Replace the old cache drive with the new one

Restart the array & go on about my day.

 

I'm hoping there's a straightforward command line sequence I can issue, that will take care of the whole process locally (w/o moving the files across my network.) 

 

Searching, I found this online, but have no idea if it'd be a safe command line to issue...

 

ssh [email protected] "(cd / ; tar cf - . )" | (mkdir -p /local_dir ; cd /local_dir ; umask 000 ; tar xvf -)

 

Thanks!

 

 

Link to comment

1.  Note the model/serial of the current cache drive.

 

2.  Stop array, install new cache drive.

 

3.  Restart array.

 

4.  At the console, run "lsscsi" and identify the sdX device for the OLD cache drive

 

5.  Make a directory to mount the old cache drive:  (mkdir /mnt/old_cache)

 

6.  Mount the old cache drive:  (mount /dev/sdX /mnt/old_cache)

 

7.  Rsync the old cache drive to the new: (rsync -avhW --stats --progress --no-compress  /mnt/old_cache /mnt/cache)

 

8.  Unmount the old cache drive: (umount /mnt/old_cache)

 

9.  Remove old cache drive.

Link to comment

4.  At the console, run "lsscsi" and identify the sdX device for the OLD cache drive

 

Your cache drive will not have a "X". You replace the "X" with whatever letter the command "lsscsi" gives for your cache drive. It should be something like (a,b,c... Ect) just make SURE whichever letter you enter is the cache drive and not a data drive.

Link to comment

Issued the command "mount -t reiserfs /dev/hda1 /mnt/old_cache"

 

The copy command seemed to work, but after about 15 minutes, stopped with the following:

 

"rsync: writefd_unbuffered failed to write 5 bytes to socket [generator]: Broken pipe (32)Killed"

"rsync error: error in rsync protocol data stream (code 12) at io.c(1530) [generator=3.0.7]"

Link to comment

I didn't use the "-t reiserfs" part when I mounted the drive. I am not sure what that error means but I might try the following.

 

1. Do step 8

2. Redo step 6 with this command (mount /dev/hda1 /mnt/old_cache)

3. Go to step 7.

 

Again I have no clue what that error means (if anyone else does please let us know) but I would probably try that if it was me.

Link to comment

I think I'm onto something.

 

I've tried to follow everyone's instructions to-the-letter, without too much second-guessing...and I think I've made a fundamental error.

 

I followed step 2.  I 'installed new cache drive'  (And by that, I mean I physically put it into my server....but that's ALL I've done.)  It isn't formatted.  It hasn't been mounted as a cache drive.  Nothing!  It's just there....as sdb.  I just aSsUmED rsync took care of that, but I'm beginning to think otherwise.  I just tried some commands on my own; mkdir /mnt/new_cache......works, but the next step- mount /dev/sdb /mnt/new_cache....DOESN'T

 

This new drive has to be installed AND FORMATTED resiserfs FIRST, doesn't it??????

 

I'd like to deviate from bubbaQ's list.  Rather than start my array with a new cache drive and watch as things go haywire with my plugins, can't I just FORMAT this drive from terminal, create the /mnt/new_cache directory, mount /dev/sdb /mnt/new_cache, then change his rsync command line to rsync -avhW --stats --progress --no-compress /mnt/old_cache /mnt/new_cache, then stop my array, change my config to point to the new cache drive  ........all without EVER introducing the system to a 'blank' cache drive???

 

If so, you know what my next question is going to be:  what's the command line to properly format sdb .... and can I do that while the array is running?

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...