Restrict IO usage using cgroups [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am trying to restrict Io usage on my server using cgroups.
Here is my partition table info:
major minor #blocks name
8 0 10485760 sda
8 1 9437184 sda1
8 2 1047552 sda2
Here is my Filesystem structure:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 8.9G 8.4G 37M 100% /
none 1004M 0 1004M 0% /dev/shm
When i am trying to execute the following command:
echo "8:1 10485760" >
/cgroup/blkio/test2/blkio.throttle.write_bps_device
I get the output as :
-bash: echo: write error: No such device
Here is my cgroups configuration:
mount {
blkio = /cgroup/blkio;
}
group test2 {
blkio {
blkio.throttle.write_iops_device="";
blkio.throttle.read_iops_device="";
blkio.throttle.write_bps_device="";
blkio.throttle.read_bps_device="";
blkio.weight="";
blkio.weight_device="";
}
}
Why i can not restrict the /dev/sda1 IO usages?

You need to use the physical device when setting up blkio. Use the major:minor for the whole disk (8:0).

Related

How to move Free space from One partition to another 100% Full Partition in Linux CentOS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
We have a Linux CentOS server. Our 1 partition "/dev/md3" is 100% used. That's why Mongo DB is not being connected. Can someone let me know how to solve this issue. I think mounting the partition is the solution? But I also have to make sure that Data should not be destroyed.
The space details are the following. "/dev/md3" is the full and "/dev/md4" has 900 GB Free. We need to increase the space in "/dev/md3". So our all services & Mongo DB should start working again.
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 65844948 0 65844948 0% /dev
tmpfs 65888636 0 65888636 0% /dev/shm
tmpfs 65888636 10760 65877876 1% /run
tmpfs 65888636 0 65888636 0% /sys/fs/cgroup
/dev/md3 20026172 19997792 0 100% /
/dev/md2 498468 88837 379375 19% /boot
/dev/nvme0n1p1 522228 2660 519568 1% /boot/efi
/dev/md4 901136592 258420 855080032 1% /home
/dev/loop0 763700 1200 722872 1% /tmp
tmpfs 13177728 0 13177728 0% /run/user/0
Or is there any way to move Mongo DB to another partition with more space?
You can't move free-space. What you need to do is move some of the files on the / partition into the /home partition. (With out rebuilding the system)
It may be easiest to move the MongoDB itself, since that's the thing you want to be able to grow.

Memory Partitioning in AWS EC2 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I need to launch an EC2 of instance type r3.4xlarge from a snapshot of a free-tier instance I initially had.
Now, first, I launched it directly, without editing the storage options. I was left with 8GiB root volume, 61GiB in /udev [ /dev ] and another 61GiB in none or /run/shm.
My question is: WHERE IS MY 122GB MEMORY AND HOW CAN I ACCESS IT?
The things that I have tried:
Added volume to the root, increased root size from 8GiB to 15GiB using these instructions. I also ended up with an increased root volume from 8GiB to 117GiB in my second attempt, when I tried to use 118GiB from my 122GiB, and changed the volume size of the root device during launch of the instance from the AMI. The problem here is that: Only the root volume changes from 8GiB to 117GiB, the /udev and /run/shm still have a total of 61GiB each.
Filesystem Size Used Avail Use% Mounted on
udev 61G 12K 61G 1% /dev
tmpfs 13G 328K 13G 1% /run
/dev/xvda1 117G 6.3G 105G 6% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 61G 0 61G 0% /run/shm
none 100M 0 100M 0% /run/user
Tried to Partition the existing system. Using these instructions. When I attempt sudo pvs there is no output and the terminal shows me the prompt. When I do sudo lvs, I get No Logical Volumes found. I then try to do this before I try to do anything with lvm2. But it's still the same on reboot.
Kindly help me with this issue. I'm stuck at a difficult place.
You are confusing RAM and Volume storage. An r3.4xlarge has 122GB of RAM. This is available for your applications to use, try:
free -m
to see more about your RAM.
r3.4xlarge comes with 1 320GB SSD ephemeral storage.

Inode Number Full Ubuntu [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have a ubuntu machine with 8Gb of RAM and 250B of Harddisk. I am using this machine as my Jenkins Server for CI , Iam facing inode number full problem from the past few days
I fire command :
df -i
Output:
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda5 18989056 15327782 3661274 81% /
none 989841 11 989830 1% /sys/fs/cgroup
udev 978914 465 978449 1% /dev
tmpfs 989841 480 989361 1% /run
none 989841 3 989838 1% /run/lock
none 989841 8 989833 1% /run/shm
none 989841 39 989802 1% /run/user
Suggest how to resolve this.
The program mkfs.ext4 allows an open -N which sets the number of inodes when making a new file system.
In this case you'd need to backup the entire / file system, boot from a live CD/USB and recreate the filesystem on /dev/sda5. WARNING: This will kill every single file on that drive. You'll probably need to reinstall the operating system onto that partition first because merely restoring a backup of a boot drive will likely not get all the fiddly bits necessary to boot.
If you are running out of inodes, it is likely you are doing something sub-optimal like using the filesystem as a poor-man's database. It is worth looking into why you are exhausting i-nodes, but that's another question.

Mounting a Windows XP dd image fails [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a Windows XP dd image. I'm checking the image with the file command:
root# fdisk -l ./hdddump.img
Disk ./hdddump.img: 2031 MB, 2031400960 bytes, 3967580 sectors
Units = Sektoren of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xef8b000a
Gerät boot. Anfang Ende Blöcke Id System
./hdddump.img1 63 3354623 1677280+ 7 HPFS/NTFS/exFAT
./hdddump.img2 3354624 3967487 306432 b W95 FAT32
Afterwards I'm trying to mount the image:
root# mount -t auto -o loop,ro,noexec,offset=32256 hdddump.img ./hddmount/
mount: /absolute_path/hdddump.img: failed to setup loop device: numerical result out of range
I have no idea why this happens and I can't find any hint in the internet. Converting the image with qemu-img and including it as harddisk in a VM Ware machine works, so the image isn't broken.
Try adding sizelimit=858767360 to your mount options. Maybe there's a problem if losetup (called by mount) tries to auto-calculate the size.
(858767360 =1677280*512)
But this question would better be asked on superuser or maybe serverfault.

List all harddrives in a linux system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm having problems to detect which one of my block devices is the hard drive. My system has a cd-rom drive, USB drives, and a single hard drive of unknown vendor/type.
How can I identify the hard drive with a linux command, script, or C application?
sudo lshw -class disk
will show you the available disks in the system
As shuttle87 pointed out, there are several other posts that answer this question. The solution that I prefer is:
root# lsblk -io NAME,TYPE,SIZE,MOUNTPOINT,FSTYPE,MODEL
NAME TYPE SIZE MOUNTPOINT FSTYPE MODEL
sdb disk 2.7T WDC WD30EZRX-00D
`-sdb1 part 2.7T linux_raid_member
`-md0 raid1 2.7T /home xfs
sda disk 1.8T ST2000DL003-9VT1
|-sda1 part 196.1M /boot ext3
|-sda2 part 980.5M [SWAP] swap
|-sda3 part 8.8G / ext3
|-sda4 part 1K
`-sda5 part 1.8T /samba xfs
sdc disk 2.7T WDC WD30EZRX-00D
`-sdc1 part 2.7T linux_raid_member
`-md0 raid1 2.7T /home xfs
sr0 rom 1024M CDRWDVD DH-48C2S
References:
https://unix.stackexchange.com/q/4561
https://askubuntu.com/q/182446
https://serverfault.com/a/5081/109417
If you have a list of the plausible block devices, then the file
/sys/block/[blockdevname]/removable
will contain "1" if the device is removable, "0" if not removable.

Resources