Unable to extend the root volume /dev/root of a Yocto build VM - linux

I have created an emulator yocto build VM. The *.vmdk file provided create an space of around 273MB. Its too small, when new terminal is opened its root memory gets full.
I can mount a drive but but it remians as external hdd.
Result of df -h
Filesystem size used available use% mounted on
/dev/root 273.5M 273.5M 0M 100% /
devtmpfs 500.0M 0 500.0M 0% /dev
tmpfs 500.3M 0 500.3M 0% /dev/shm
tmpfs 500.3M 9.4M 490.9M 2% /run
tmpfs 500.3M 0 500.3M 0% sys/fs/cgroup
tmpfs 500.3M 9.4M 490.9M 2% /etc/machine-id
tmpfs 500.3M 16.0K 500.3M 0% /tmp
Even I tried to change the ROOTFS and increase the size of root directory but it failed to increase.

Related

How to limit disks IO of Docker container?

I am working with Docker containers and observed that they tend to generate too much disk IOs.
I found the --device-write-bps option which seem to address my need of limiting the disk IOs.
However, this option expects a path to a device, but the latest Docker drivers do not allow me to determine what to set (device is overlay with overlay2 storage driver). Here is what df -h outputs in my case:
Filesystem Size Used Avail Use% Mounted on
overlay 59G 5.3G 51G 10% /
tmpfs 64M 0 64M 0% /dev
tmpfs 994M 0 994M 0% /sys/fs/cgroup
shm 64M 0 64M 0% /dev/shm
/dev/vda1 59G 5.3G 51G 10% /etc/hosts
tmpfs 994M 0 994M 0% /proc/acpi
tmpfs 994M 0 994M 0% /sys/firmware
Is the option compatible with the latest drivers? If yes, would someone know what is the path to set?
Thanks!
It seems I was mistaken by the doc. The device to specify for the --device-write-bps option is the device of the host machine. So the mount command is useful, but needs to be run on the host ^^

Setting up a swapfile in local SSD (temporary drive) in Azure VM

I'm using a DS4 Azure VM (Ubuntu 14.04). It comes with a 56GB local SSD.
I need to set up a 25GB swapfile in this local SSD. When I do df -h in the VM, I can see that it seems to be mapped to the /mnt/ folder. Following is the entire output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 29G 22G 6.4G 77% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 14G 4.0K 14G 1% /dev
tmpfs 2.8G 472K 2.8G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 14G 0 14G 0% /run/shm
none 100M 0 100M 0% /run/user
none 64K 0 64K 0% /etc/network/interfaces.dynamic.d
/dev/sdb1 56G 97M 56G 1% /mnt
However, if I try to initialize a swapfile in /mnt, it still gets added to the available disk space in /dev/sda1.
What do I need to do to set up my swap file? An illustrative example would be great. Thanks in advance.
I normally use the following commands to set up a swapfile:
sudo fallocate -l 25G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Update:
I went into /etc/waagent.conf, and tweaked the followed:
# Format if unformatted. If 'n', resource disk will not be mounted.
ResourceDisk.Format=y
# File system on the resource disk
# Typically ext3 or ext4. FreeBSD images should use 'ufs2' here.
ResourceDisk.Filesystem=ext4
# Mount point for the resource disk
ResourceDisk.MountPoint=/mnt
# Create and use swapfile on resource disk.
ResourceDisk.EnableSwap=y
# Size of the swapfile.
ResourceDisk.SwapSizeMB=26000
After this, I resized (and consequently rebooted) my Azure VM from the portal. Currently I can't tell whether the settings have taken effect. Are my settings correct and what's the best way to ensure they've taken effect?
You are right, we should modify /etc/waagent.conf to add a swap file.
By modifying the /etc/waagent.conf file and setting the following 3 parameters a swap file will be created in the directory defined by ResourceDisk.MountPoint  
 
ResourceDisk.Format=y  
ResourceDisk.EnableSwap=y    
ResourceDisk.SwapSizeMB=26000
Then we should restart walinuxagent:
service walinuxagent restart
Commands to show the new swap space in use after agent restart:
dmesg | grep swap
root#ubuntu:~# swapon -s
Filename Type Size Used Priority
/mnt/swapfile file 26623996 0 -1
root#ubuntu:~# df -Th
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 3.4G 12K 3.4G 1% /dev
tmpfs tmpfs 697M 412K 697M 1% /run
/dev/sda1 ext4 29G 869M 27G 4% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 3.5G 0 3.5G 0% /run/shm
none tmpfs 100M 0 100M 0% /run/user
/dev/sdb1 ext4 99G 26G 68G 28% /mnt
I resized (and consequently rebooted) my Azure VM from the portal
I resized my VM, and the swap file does not lose.
Are my settings correct and what's the best way to ensure they've
taken effect?
After modify the /etc/waagent.conf and restart walinuxagent, we can use swapon -s to check it.

How do I create an XFS volume out of root volume on EC2?

I've created a new EC2 instance and setting up a bunch of software on it. MongoDB 3.2's Production checklist suggests installing it on an XFS (or ext4) volume. How do I create a volume of, say 15 GB, out of /dev/xvda1, format is as XFS using mkfs and then mount it? Here's the output of df -h right now:
udev 492M 12K 492M 1% /dev
tmpfs 100M 340K 99M 1% /run
/dev/xvda1 30G 2.5G 26G 9% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 497M 0 497M 0% /run/shm
none 100M 0 100M 0% /run/user
OS is Ubuntu 12.04 LTS
Does it have to be the root partition?
If not, you can simply create a new volume in the AWS EC2 UI and attach it to the instance. It will show up as e.g. /dev/xvdf and you can format and mount it.
Also, this might answer your question.

how to designate Cassandra data storage to certain file-system partition?

I used Cassandra to store my data. I use Centos.
The data seems always to be stored in the root partition, which is too small.
My file system partitions like
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 25G 26G 49% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 17M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/sda2 494M 177M 318M 36% /boot
/dev/sda1 200M 9.8M 191M 5% /boot/efi
/dev/mapper/centos-home 873G 66G 807G 8% /home
tmpfs 1.6G 0 1.6G 0% /run/user/1001
Obviously the root partition (50 GB) is much smaller than one at home (873GB).
Is there a way that I change a setup to enforce data storage using the
partition "/dev/mapper/centos-home" ?
I need to use the command "sudo service cassandra start" to activate Cassandra.
If without sudo, my authority doesn't allow me to activate Cassandra.
Thanks!
Edit the $CASSANDRA_HOME/conf/cassandra.yaml file (sometimes it is
located under /etc/cassandra also, depending on how you install
Cassandra)
Update the following properties
(only available since Cassandra 3.x) hints_directory: /var/lib/cassandra/hints // put your own directory here
data_file_directories: //put a list of directories here
/var/lib/cassandra/data
commitlog_directory: /var/lib/cassandra/commitlog // put your own directory here
saved_caches_directory: /var/lib/cassandra/saved_caches // put your
own directory here

How to increase ec2 instance root file system without EBS?

How to increase disk space of an instance without using EBS ? Root file system size is only showing 10 GB. Is there a way to create a bigger file system without EBS ?
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 9.9G 3.3G 6.1G 35% /
tmpfs 874M 0 874M 0% /lib/init/rw
udev 874M 84K 874M 1% /dev
tmpfs 874M 0 874M 0% /dev/shm
/dev/sdb 335G 12G 307G 4% /mnt
As you can see in the output, a much bigger partition is mounted at /mnt. You can move some of the things on the root filesystem there by either remounting it at the appropriate location or add symlinks. There is no other way to add more diskspace if you don't want to resort to EBS or a network filesystem.

Resources