Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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!

 

 

I would stop the array before mirroring the cache contents.

 

Using tar just adds to the process, simple cp or rsync should work and not have as much overhead.

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.

  • Author

I ran into trouble at step #5.  "mount: you must specify the filesystem type"

 

In response to the command line, which was: mount /dev/hda /mnt/old_cache  (Old cache drive is on the IDE bus, hence the hda)

 

I looked online and appending "-t auto" to the line gave the same result.

 

??

I just did this. At step 6 I got that same error. I changed /dev/sdX to /dev/sdX1 and then It mounted.

The cache file system is on the first partition.

The correct command for 6 is:

6.  Mount the old cache drive:  (mount -t reiserfs /dev/sdX1 /mnt/old_cache)

Note the trailing"1" needed  on the device name.

  • Author

Nope...

 

Response:  "mount: special device /dev/sdX1 does not exist"

 

Tried with upper and lower case "X"....same response.

 

I stopped the array before trying this.  Does it need to be started? 

 

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.

  • Author

Ah, but as I commented in my first post- the old/current cache drive is on the IDE bus. 

It doesn't even show up for the lsscsi command....  Do I use hda instead of sdX ??

I am not familiar with unRAID and IDE drives, however if you only have one IDE drive then I would assume that hda would be correct. You could check to make sure after you mount hda  you can type "MC" into the console and go to "mnt" -> "old_cache" and make sure it has all your cache files.

  • Author

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]"

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.

  • Author

Exact same error- only this time after 34 minutes of copying.

 

:(

You could try running midnight commander to copy it over...

 

Do steps 1-6

7. Type "MC" in terminal

8. Have "old_cache" on left side of mc and "cache" on the right. Then use the copy feature and see if that works.

  • Author

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?

 

 

"Install" new cache drive means stop array, insert new drive,  change cache drive config config to point to new cache drive, restart array, format cache, and have it ready to accept files with the array started.

 

All you did was "Insert" the new cache drive.

If you reboot your server and boot into safe mode you can start your server without plugins. Then copy over everything. That is what I did.

  • Author

The drive is tied up in a preclear cycle right now, but thanks for getting back with me, guys.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.