I have an ext4 partition at the end of an hard drive, and want to resize it to the full disk size (the rest of the disk is empty). It's not the root partition, just a data partition, so it's no problem to unmount the partition. The machine has Ubuntu server running, and neither Screen, keyboard, mouse nor optical disk drive attached, so booting a live environment to use this approach would be a bit of a hassle and I'd like to avoid that.
Anybody know an easy way to do this? For me, this proves to be a far more difficult task than I had anticipated, but let me elaborate:
Of course the disks partitions were all unmounted during the following operations. I first tried via parted: I deleted the first partition which was not needed anymore, then wanted to resize or move the ext4 partition. But parted told me it wasn't able to do so, because of some filesystem features of ext4 (with a weird error message: "Error: File system has an incompatible feature enabled. Compatible features are has_journal, dir_index, filetype, sparse_super and large_file. Use tune2fs or debugfs to remove features." - so what are the incompatible features?); what I got from that, and as an answer on comments in another question, it is somehow not possible for parted to change the start of an ext4 partition.
Why can gparted, however, seemingly do the trick (see first linked question) but not parted?
Well, since I had enough space at the start of the drive left (more than the size of the partition to move) I thought I'd try another approach: create a second partition at the front, copy the contents from the one at the back to this one, then delete the old partition and resize the new to the full size. However, this also proved impossible: After creating the partition and copying the contents (via
dd if=/dev/sdb2 of=/dev/sdb1), the partition can't be mounted ('missing journal superblock').
So at the moment I'm fresh out of ideas. I'll probably copy everything vital to another disk, delete all partitions again and create one big one. I'm wondering that this is such a problem - or am I overlooking the obvious?