Replace Hard Drive With All Shares

MeasureTech
Posts: 17
Joined: Tue Apr 08, 2014 6:13 pm

Replace Hard Drive With All Shares

Postby MeasureTech » Thu Jul 17, 2014 9:53 pm

I have a simple setup (for now): 1 hard drive with the OS; 1 with ALL of my shares (partition /dev/sdb1; mount point: var/hda/files).

I bought a new hard drive with more space and I'd like to replace the hard drive with all the files. My plans were:

A) Backup data
B) Power down server
B) Remove old hard drive; install new one
C) Follow steps via https://wiki.amahi.org/index.php/Adding ... o_your_HDA
D) Enjoy all the new space :D

Then I realized when I remove the old hard drive and install the new one, the server will probably not boot correctly because it will be trying to find the old drive.

So I searched the forums a bit and realized I probably need to unmount the drive.

So now my plan is:

A) Backup data
B) Unmount old hard drive
C) Power down server
D) Remove old hard drive; install new one
E) Follow steps via https://wiki.amahi.org/index.php/Adding ... o_your_HDA
F) Enjoy all the new space :D

Does this sound correct? If so, is the proper unmount command:

umount /dev/sdb1 (or umount /var/hda/files?)

Is that all I need to do?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Replace Hard Drive With All Shares

Postby bigfoot65 » Fri Jul 18, 2014 4:29 am

A) Backup data
B) Unmount old hard drive
C) Power down server
D) Remove old hard drive; install new one
E) Follow steps via https://wiki.amahi.org/index.php/Adding ... o_your_HDA
F) Enjoy all the new space :D

Does this sound correct? If so, is the proper unmount command:

umount /dev/sdb1 (or umount /var/hda/files?)

Is that all I need to do?
What I would do is install the new drive first and get it formatted. You can mount it as something different. Then copy all your share files over to it. Unmount the old drive and new drive. You can then remount the new drive as /var/hda/files.

Once you have done that, remove the old drive. That will save you some time and ensure you copy over all that is on the old drive. If you are using Greyhole, it could be done differently and we can discuss that if needed.

BTW, the unmount for drives is the path they are mounted based on /etc/fstab. For the old drive it would be

Code: Select all

umount /var/hda/files
Does that make sense?
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

MeasureTech
Posts: 17
Joined: Tue Apr 08, 2014 6:13 pm

Re: Replace Hard Drive With All Shares

Postby MeasureTech » Fri Jul 18, 2014 6:13 am

A) Backup data
B) Unmount old hard drive
C) Power down server
D) Remove old hard drive; install new one
E) Follow steps via https://wiki.amahi.org/index.php/Adding ... o_your_HDA
F) Enjoy all the new space :D

Does this sound correct? If so, is the proper unmount command:

umount /dev/sdb1 (or umount /var/hda/files?)

Is that all I need to do?
What I would do is install the new drive first and get it formatted. You can mount it as something different. Then copy all your share files over to it. Unmount the old drive and new drive. You can then remount the new drive as /var/hda/files.

Once you have done that, remove the old drive. That will save you some time and ensure you copy over all that is on the old drive. If you are using Greyhole, it could be done differently and we can discuss that if needed.

BTW, the unmount for drives is the path they are mounted based on /etc/fstab. For the old drive it would be

Code: Select all

umount /var/hda/files
Does that make sense?
First of all, I'm not using Greyhole.

Yeah, I think that makes sense I should be able to manage that. So I can temporarily mount the new drive anywhere, unmount both, then mount the new one as /var/hda/files. My only concern is if I have room for a 3rd hard drive. I'm using some older hardware for now (plan on buying new in the near-ish future) am not 100% sure if I have room for a 3rd hard drive. If I do, I'll proceed as you described. If I don't, will the method i described work (perhaps it's just not the safest way)?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Replace Hard Drive With All Shares

Postby bigfoot65 » Fri Jul 18, 2014 8:14 am

Ok, not using Greyhole makes it just as easy.

If you don't have room for the extra drive, the other method will work. Using the hda-diskmount script, the drive will be mounted in /var/hda/files/drives.drive#. As long as both drives are mounted at the same time, no big deal. With them both mounted, it's just a simple cp -r /var/hda/files/* command.

The other method just takes more steps, but still effective. Hope the change over works without issue for you.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

MeasureTech
Posts: 17
Joined: Tue Apr 08, 2014 6:13 pm

Re: Replace Hard Drive With All Shares

Postby MeasureTech » Fri Jul 18, 2014 2:20 pm

Ok, not using Greyhole makes it just as easy.

If you don't have room for the extra drive, the other method will work. Using the hda-diskmount script, the drive will be mounted in /var/hda/files/drives.drive#. As long as both drives are mounted at the same time, no big deal. With them both mounted, it's just a simple cp -r /var/hda/files/* command.

The other method just takes more steps, but still effective. Hope the change over works without issue for you.
Ok, Thanks a lot!

I guess my only remaining question is, Do I need to edit /etc/fstab to remove the old drive so it no longer tries to mount it? Or is that taken care of by the umount command?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Replace Hard Drive With All Shares

Postby bigfoot65 » Fri Jul 18, 2014 5:41 pm

Yes you need to manually remove it. The umount command only unmounts the drive.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

MeasureTech
Posts: 17
Joined: Tue Apr 08, 2014 6:13 pm

Re: Replace Hard Drive With All Shares

Postby MeasureTech » Sat Jul 19, 2014 11:31 pm

Everything actually went pretty smooth with the hard drive swap. Unmounted the drive and removed the info. on it from /etc/fstab and the rest came along pretty well. Except for one thing (of course). On boot, I get the following error:

cifs_mount failed w/return code = -6

I realized this is linked to the mount_shares_locally script. I re-ran through the setup on the Wiki multiple times and I can't find anything wrong. Prior to the hard drive swap, my mount_shares_locally was working fine. From what I can tell, the script is still doing the job, i.e., the shares are mounted at /mnt/samba/share but I don't know what's the cause of that error. Any thoughts?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Replace Hard Drive With All Shares

Postby bigfoot65 » Sun Jul 20, 2014 7:13 am

Not sure if it will help, but try stopping the mount_shares_locally script. Then delete all the shares in /mnt/samba. Restart the script and see if the error is still present.

I had to do that once. Also ensure all the shares appear correctly as they did before in /mnt/samba directory.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 5 guests