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?
script
andpastebinit
with the-i
flag for this. Then edit your question to provide either a link to the pastebin, or (if it's only a couple hundred lines or less) the text itself. ...Do you have SSH access to this server from another Ubuntu system (or any Unix-like system)? If so, you may be able to installgparted
and run it viassh -X
.ssh -X
, right? I'll try to provide the exact commands & error messages, but it might take a while to recreate them, I didn't take notes since nothing really vital is on that disk at the moment (for the most part, "just" the backup of backups). Basically I'm doing this out of curiosity - it must be possible, right? But I'm feeling more and more confident that copying the contents, deleting, and recreating is the simplest solution...ssh -X
, the X server has to be installed on the SSH client, not the SSH server. The vast majority of Unix-like systems with GUI's have what is needed to connect as an SSH client with-X
(except Mac OS X, if you didn't install the X11 component). See en.wikipedia.org/wiki/X_server#Design for further explanation.