File system shows image size after cloning, rather than imag

First attempt, so please help.

I created a disk image of 3.9GB earlier. Today I copied it to a new linode /dev/xvda that was 24GB. My reading indicated that the destination needed to be at least as large as the image I was copying, however, while fdisk -l /dev/xvda shows: Disk

/dev/xvda: 25.2 GB, 25232932864 bytes

df -h shows

/dev/xvda 3.9G 3.2G 550M 86% /

What will I need to do to resolve this?

5 Replies

How exactly did you copy it? Using the clone/duplicate functions in the dashboard, or some other mechanism?

If you simply copied the raw bits from one linode to another yourself, you'll need to use resize2fs to expand the filesystem into the remaining empty space. -rt

I used the procedure in Copying a Disk Image to a Different Account Linode Doc, http://library.linode.com/migration/cop … nt-account">http://library.linode.com/migration/copy-disk-image-different-account

My thought is to use the resize in the dashboard to 4GB, and then back. Will that work?

It would, or you can just reboot into Finnix Rescue Mode, e2fsck -f /dev/xvda, resize2fs /dev/xvda, and reboot normally. The reason for the discrepancy is you dd-ed an entire filesystem, including the information the filesystem uses to figure out how big it is. resize2fs without any other parameters besides the disk to operate on means 'grow to match the size of the device' and so will get you to 24 GB.

-Doug

Much thanks for the suggestions from all you first responders. I ended up just trying to resize to 4GB from the dashboard, and again to the final size. It appears that resolved the issue, and was selected because I thought it would be easier to understand by someone following me. Again, much thanks.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct