I have a server server1 running 8GB root partition
I have taken the ami of this server1 and created anothe server2 but changed the root partition to 60GB
3.I wanted to extend the linux partition in the server2 and followed the below link: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage_expand_partition.html But It is failed. Please let me know what I had missed ? /dev/xvdf is the root partition attached to another instance for resize.
root@ip-172-31-254-234:~# fdisk -l
Disk /dev/xvda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 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
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/xvda1 * 16065 16771859 8377897 83 Linux+
Disk /dev/xvdf: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders, total 125829120 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
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/xvdf1 * 16065 16771859 8377897 83 Linux+
root@ip-172-31-254-234:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
ââxvda1 202:1 0 8G 0 part /
xvdf 202:80 0 60G 0 disk
ââxvdf1 202:81 0 8G 0 part
root@ip-172-31-254-234:~# parted /dev/xvdf
xvdf xvdf1
root@ip-172-31-254-234:~# parted /dev/xvdf
GNU Parted 2.3
Using /dev/xvdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
(parted)
(parted)
(parted) print
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdf: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 8225kB 8587MB 8579MB primary ext4 boot
(parted) unit s
(parted)
(parted)
(parted) print
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdf: 125829120s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 16065s 16771859s 16755795s primary ext4 boot
(parted) rm 1
Warning: Partition /dev/xvdf1 is being used. Are you sure you want to continue?
Yes/No? yes
(parted)
(parted)
(parted) print
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdf: 125829120s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
(parted) mkpart primary 2048s 100%
(parted) print
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdf: 125829120s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 2048s 125829119s 125827072s primary
(parted) set 1 boot on
(parted) print
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdf: 125829120s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 2048s 125829119s 125827072s primary boot
(parted) quit
Information: You may need to update /etc/fstab.
root@ip-172-31-254-234:~# sudo e2fsck -f /dev/xvdf1
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/xvdf1
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>