This question already has an answer here:
Hello Ladies and Gents,
I apologize if the question isn't phrased as well as it should be; it's getting late and I've been staring at this screen for way too many hours after work. My core competency is Java. I really only dabble with server maintenance when I have to.
My question is basically the same as this guy's, although I hope I don't get smacked around by commentators as much as he did.
I've created a RHEL6 server with Amazon Web Services (AWS) and selected a 100GB hard drive. However, when I bootup the system and look at the disk space, I get this:
Filesystem Size Used Avail Use% Mounted on /dev/xvda1 5.8G 2.0G 3.6G 35% / tmpfs 1.8G 0 1.8G 0% /dev/shm
And like that previous guy, I tried resize2fs and received:
The filesystem is already 1572864 blocks long. Nothing to do!
I was really hoping someone would expand upon the accepted answer:
Use fdisk to create a new partition Create a filesystem using mkfs Add the new partition into a convenient filesystem location using mount. Update the /etc/fstab as appropriate.
Combined with a similar post, there have been ~3,200 views of this question over the last 2 years without a detailed answer. Additionally, the reams of documents I've read online haven't been helpful either. This is someone's chance to be an internet hero.
I really don't want to create a separate partition but rather have the main /dev/xvda1 take up the entire disk's space. In fact, the default Amazon Linux image does this very exact thing by default.
Thank you in advance.
* Update 1 *
Output of fdisk -l -u /dev/xvd
WARNING: GPT (GUID Partition Table) detected on '/dev/xvda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/xvda: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders, total 209715200 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 1 20971519 10485759+ ee GPT
Output of lsblk gave me
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 100G 0 disk └─xvda1 202:1 0 6G 0 part /
* Update 2 * The next thing I've tried is to create a snapshot of xvda1 and then create another 100GB volume from this snapshot. I then used the directions in this Amazon AWS link to use parted to create a 100GB partition.
I then switched the two hard drives so that my new 100GB was my boot disk. However, it appears my server refuses to now bootup and fails the instance checks. Back to the drawing board.
* Answer *
I finally figured out an answer, which had NOTHING to do with the "duplicate's" answer. Duplicate my rear end.
- Create your RHEL instance. Go ahead and make the hard drive 100GB.
- Once it gets done initializing, shut it down. Then create a snapshot of the hard drive.
- Create a new volume from your snapshot. Make it 100GB also.
- Attach the new hard drive to your instance. Leave it as the default /dev/sdf
- Boot up your instance and ssh into it.
- From the command line, run the following lines (minus the $) to remove and create a new 100GB partition. Excuse the formatting. This question's editor has gone bonkers.
You will get a couple of warnings talking about extra space. Select the Fix It route
$ rm 1
$ unit GB
$ mkpart ext4 0 100%
$ set 1 boot on
You should see a 100GB+ system.
Shut down the system and detach the /dev/sdf drive. You should have only the /dev/sda1 drive attached. Boot your instance back up, SSH into it, and type 'df -h'. And what do you see?
Filesystem Size Used Avail Use% Mounted on /dev/xvda1 99G 2.0G 92G 3% / tmpfs 1.8G 0 1.8G 0% /dev/shm
Drops the mic and walks off stage
* This is NOT a duplicate question *
Following the steps listed in the previous questions "answer" do not provide a sufficient explanation. I want a full disk, not a separate partition.