Moving shares/Replace HDD

tamorgen
Posts: 53
Joined: Wed Jul 17, 2013 1:48 pm

Moving shares/Replace HDD

Postby tamorgen » Wed Dec 06, 2017 6:15 am

Good morning,
I'm trying to replace two of my smaller HDD in my Amahi Home Server with two, 4 TB Toshiba drives. I'm not having much luck. First, I tried to follow the directions of creating a driver larger than 2.1 TB, https://wiki.amahi.org/index.php/Partitions_Over_2.1_TB and it's getting hung up on making the partition:

Code: Select all

parted /dev/sdb mkpart primary ext4 2048 -1
Amahi/Fedora doesn't seem to like -1. Adding the HDD doesn't seem to work from the Disk Wizard App on the Amahi dashboard as it can't seem to support GPT drives (throws an error), so I'm left with command line or Plan C.

So, for Plan C, I booted to a USB Rescue Disk, and created the GPT/EXT4 partition from GPARTED, and it worked just fine. I reattached that drive to my server, and then proceeded to do whole partition copy using:

Code: Select all

dd if=/dev/sda1 of=/dev/sdb1 bs=64K conv=noerror,sync status=progress
I took this drive, rebooted with my Linux Rescue USB, and used GPARTED to expand the partition to it's full potential. (Feature Request, make Amahi 11 so we can actually use the GUI interface, and not just CLI. I'm fine with most CLI, but sometimes the GUI is just easier).

At this point, I commented out the old drive in /etc/fstab, unmounted the smaller drive, and swapped the drives. I ran hda-diskmount, and it couldn't find the partitions. I ran fdisk -l, and it showed the drive, but unknown partition type, unknown label. At this point, I'm really frustrated.

So, I move on to Plan D. I put the small HDD back in, uncomment from /etc/fstab, remount the drive, and proceed to try and just move the data off the drive using

Code: Select all

greyhole --going /var/hda/files/drive1/gh &
I let it run last night, and this morning I did a ps -ef | grep greyhole, and I didn't see the greyhole --going process running. So, in theory, it's moved the data. Problem is, I looked at the drive utility on the Amahi dashboard, and it's telling me that that drive is still a significant portion full. So I don't know if greyhole --going did anything or not. The greyhole --going command also didn't seem to do anything on the Amahi dashboard in regards to showing that drive as part of the pool.

What should my next step be? I really don't want to loose data. I'm trying to follow directions from the Wiki or from the forums, but both are rather out of date, showing methods for both Ubuntu, Fedora, CLI, and Amahi dashboard, with none of them seem to be working as expected.

tamorgen
Posts: 53
Joined: Wed Jul 17, 2013 1:48 pm

Re: Moving shares/Replace HDD

Postby tamorgen » Tue Dec 19, 2017 6:27 am

Issue was solved. A few things to note. Might be obvious to some linux gurus, but wasn't to me.

I believe the issue I was experiencing was caused by a couple of issues.

1) I was mounting the drive in an external enclosure to copy the old drive to the new. For whatever reason, although I could mount the drive from a rescue USB and see all the data, when I put the drive in my server (directly into a bay), Amahi/Fedora didn't like it. My solution was to connect it to the internal SATA mount points, copy the data, then remove the old drive, and put the new drive in the exact same location as the old (same SATA connector). For whatever reason, this worked flawlessly.

2) The parted command wasn't working for my drive.

Code: Select all

parted /dev/sdb mkpart primary ext4 2048 -1
I used a different method; instead of using sectors, I used 1 MiB as the size, and it worked fine. the -1 wasn't necessary. I also just started the parted command and followed the prompts, instead of trying to do it all in one line.

3) Copying the files. Instead of using dd, I used e2image, which only copies the used blocks, and not all the blank space that DD does. This is much more efficient and cut down my migration time.

4) Expanding the partition: resize2fs -p /dev/sdx1

Who is online

Users browsing this forum: No registered users and 6 guests