Extending a volume online

Posted by & filed under Server Admin.

I was attempting to resize a GPT partition ( http://natesbox.com/blog/extending-logical-volume-online/ ). Expanded the physical disk from 4TB to 6TB. Found that fdisk reported the disk size to be 6TB, but would not let me use any of the additional sectors:

Disk /dev/sda: 6 TiB, 6597069766656 bytes, 12884901888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E3374C46-FDAA-4FA0-AFD2-1C861700B6EA

Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 503807 499712 244M Linux filesystem
/dev/sda3 503808 8589932543 8589428736 4T Linux LVM

Note the disk says it has 12884901888 sectors, but I can’t expand it past the 8589428736’th sector of /dev/sda3

Running the v command in fdisk reports:

Command (m for help): v
MyLBA mismatch with real position at backup header.
1 error detected.

Found this article: serverfault.com/questions/833231/after-h…

This recommends using gdisk to repair the issue as the backup partition table wasn’t moved to the end of the new geometry:

root@mdm-backup-01:~# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): r

Recovery/transformation command (? for help): v

Problem: The secondary header’s self-pointer indicates that it doesn’t reside
at the end of the disk. If you’ve added a disk to a RAID array, use the ‘e’
option on the experts’ menu to adjust the secondary header’s and partition
table’s locations.

Identified 1 problems!

Recovery/transformation command (? for help): x

Expert command (? for help): e
Relocating backup data structures to the end of the disk

Expert command (? for help): v

No problems found. 4294971325 free sectors (2.0 TiB) available in 2
segments, the largest of which is 4294969311 (2.0 TiB) in size.

Expert command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.

Cloning NTFS disks and extending the partition

Posted by & filed under Data Recovery, Server Admin.

I have this eye imaging computer here that needs the drive upgraded. I have a 500gb one that will be replacing it. I will need to clone the old disk to the new one.

There are several ways to clone the disk. I ended up doing it twice because I hosed it up the first time.

One way is with dd if=/dev/sda of=/dev/sdb conv=noerror,sync
It also would of been a lot faster to set the block size so it completes faster.

I can watch the progress of the dd with: while killall -USR1 dd; do sleep 5; done

Pretty normal stuff… the conv= at the end tell it to not stop on errors (bad sectors) and to sync .

The other way is with a clonezilla live cd which is how I did it the second time around. It ran a lot faster than the simple dd, and booted into windows fine as well.

Next I booted into the recovery console and ran a chkdsk /r

After that I will boot my gparted live cd and resize the partition to fill the disk.

I will then boot again into the recovery console and run chkdsk /r

Sysprep: support.microsoft.com/kb/298491
Sysprep best practices: support.microsoft.com/kb/240126
Windows 2000 recovery console info: support.microsoft.com/kb/229716
STOP 0x7b: support.microsoft.com/kb/314082/
Extending NTFS Disks: fugitivethought.com/blog.php?action=view…


Here it is laying on it’s side, complete with integrated power distribution unit and what looks to be n additional power supply (gold box).