Author:
erics, February 19th, 2021
|
# df -hT Filesystem Type Size Used Avail Use% Mounted on /dev/nvme0n1p1 xfs 20G 2.8G 18G 14% / # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme0n1 259:0 0 40G 0 disk ├─nvme0n1p1 259:1 0 20G 0 part / └─nvme0n1p128 259:2 0 1M 0 part |
Note how the partition at 259:1 is only 20GB, while the entire disk at 259:0 is 40GB. A partition resize is required in this case.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
# sudo growpart /dev/nvme0n1 1 CHANGED: partition=1 start=4096 old: size=41938911 end=41943007 new: size=83881951 end=83886047 # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme0n1 259:0 0 40G 0 disk ├─nvme0n1p1 259:1 0 40G 0 part / └─nvme0n1p128 259:2 0 1M 0 part # df -hT Filesystem Type Size Used Avail Use% Mounted on /dev/nvme0n1p1 xfs 20G 2.8G 18G 14% / # sudo xfs_growfs -d / meta-data=/dev/nvme0n1p1 isize=512 agcount=11, agsize=524159 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1 spinodes=0 data = bsize=4096 blocks=5242363, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 5242363 to 10485243 # df -hT /dev/nvme0n1p1 xfs 40G 2.8G 38G 7% / |
For more information, please visit the AMW Docs: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html
Categories: How-To's, Technology Tags: Amazon, Amazon Linux 2, AWS, df, df -hT, Disk, EBS, Expand, Filesystem, Grow, howto, Linux, Linux2, lsblk, NVMe, partition, Resize, tips, volume, XFS
|
No comments
Author:
erics, December 8th, 2015
As always, YMMV…
|
#!/bin/bash # Usage: eject [fullpath to mount point] DISK="${1:-/Volumes/YourUSBFlashDriveName/}" df -h "$DISK" > /dev/null 2>&1 if [ $? -eq 0 ]; then diskutil unmountDIsk `diskutil list "$DISK" | grep ^/dev/` else echo Volume $DISK is not mounted...skipping. fi |
Categories: How-To's, Technology Tags: apple, bash, cli, Command, Command line, Disk, diskutil, Drive, eject, Flash, howto, List, Mac, macosx, mount, Terminal, tips, umount, unmount, unmountDisk, USB, volume
|
No comments
Author:
erics, August 31st, 2014
I had to replace an ailing root volume on AWS, so I decided to double the size when I created the new volume from snapshot. After booting, I realized that df still showed the old filesystem size of 10GB, not the new size of 20GB Here is the solution: resize2fs /dev/xvda1
|
root@prod02:/root # df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 9.9G 6.4G 3.4G 66% / root@prod02:/root # resize2fs /dev/xvda1 resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/xvda1 is mounted on /; on-line resizing required old desc_blocks = 1, new_desc_blocks = 2 Performing an on-line resize of /dev/xvda1 to 5242880 (4k) blocks. The filesystem on /dev/xvda1 is now 5242880 blocks long. root@prod02:/root # df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 20G 6.4G 14G 33% / |
Categories: How-To's, Technology Tags: AWS, CentOS, ext3, Filesystem, howto, Online, Resize, resize2fs, Snapshot, tips, volume
|
No comments
Author:
erics, June 27th, 2014
PROCEDURE FOR NON-ROOT FILESYSTEMS: Run the df command and record the device path for the mount point you wish to grow. Unmount the filesystem to insure consistency. Detach the volume from the instance. Create a snapshot of the unmounted filesystem. Create a volume from the snapshot, specifying a larger size in the new volume form. […]
Categories: How-To's, Technology Tags: AWS, EBS, Grow, howto, Increase, Resize, tips, volume
|
No comments
Author:
admin, July 7th, 2012
To change the volume in smaller increments on MacOSX Snow Leopard, hold down Shift-Option when pressing either the Volume-Up or the Volume-Down keys. You should see the volume indicator show a fractional portion of the normal scale selected:
Categories: How-To's, Technology Tags: apple, Control, Fraction, Fractional, howto, Increment, Incremental, Keyboard, Keyboard Shortcut, macosx, Small increments, tips, volume, Volume Control
|
No comments
Author:
erics, October 26th, 2011
Stop MySQL and move the existing database files to the EBS volume.
|
service mysqld stop mkdir /data/mysql mv /var/lib/mysql/ /data/mysql/lib/ |
Use the bind option to the mount command in the /etc/fstab file to direct MySQL to the correct files, then restart:
|
mkdir /var/lib/mysql echo "/data/mysql/lib /var/lib/mysql none bind" | tee -a /etc/fstab mount /var/lib/mysql service mysqld start |
Categories: How-To's, Technology Tags: CentOS, howto, Linux, Migrate, Move, mysql, tips, volume
|
No comments
Author:
erics, October 26th, 2011
First, use the AWS management console to create and attach a new volume. Note the device name, in our example /dev/sdf.
|
# yum install xfsprogs-devel # mkfs.xfs /dev/sdf # echo "/dev/sdf /data xfs noatime 0 0" | tee -a /etc/fstab # mkdir -m 000 /data # mount /data # df -h # mount |
You now have a 10 GB (or whatever size you specified) EBS volume mounted under /data with an XFS file system, and it will be automatically mounted if the instance reboots.
Categories: How-To's, Technology Tags: Amazon, AWS, df, Filesystem, howto, mount, tips, volume, XFS
|
No comments