I test it for qcow2 format. Other formats are TBA. qemu-img resize kvm1.qcow2 +20G cp kvm1.qcow2 kvm1-orig.qcow2 virt-resize –expand /dev/sda1 kvm1-orig.qcow2 kvm1.qcow2 Reference: https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/ I test it for qcow2 format. Other formats are TBA. qemu-img resize kvm1.qcow2 +20G cp kvm1.qcow2 kvm1-orig.qcow2 virt-resize –expand /dev/sda1 kvm1-orig.qcow2 kvm1.qcow2 Reference: https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/
Author: Weiwei Jia
Why I cannot login remote server with its root
Posted on# ssh root@192.168.122.96 root@192.168.122.96’s password: Permission denied, please try again. Do according to [1]. NOTE: on Ubuntu, remember to restart ssh service like this “sudo restart ssh”. [1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/v2v_guide/preparation_before_the_p2v_migration-enable_root_login_over_ssh
How to search history commands very effectively in bash shell command line?
Posted onHow to search history commands very effectively in bash shell command line? Just enter CTRL+r The function of above is: (reverse-i-search)`’: It is very fast and efficient.
What are the differences between BIOS and UEFI?
Posted onBIOS: Basic Input Output Systems UEFI: Unified Extensible Firmware Interface UEFI is the advanced BIOS, which solves some limitations in BIOS such as 1, 16-bit processor mode; 2, 1 MB addressable space and PC AT hardware. References: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface
how to list and delete shared memory in linux?
Posted onhow to list and delete shared memory in linux? List all shared memories in your Linux Systems > $ ipcs -m Delete specific one > $ ipcrm -M 0x0001869c
How to get one process’s port number?
Posted onIf we want to check one program on one remote server, we need to know this server’s IP and port number. How to get this program’s port number in the remote server? # netstat -tulpn Remember to run this program with root permission since some programs can only be accessed by root.
Latex is stuck with a strange problem, see more information for details.
Posted on$ make pdflatex main.tex This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex) restricted write18 enabled. entering extended mode (./main.tex LaTeX2e <2016/02/01> Babel <3.9q> and hyphenation patterns for 81 language(s) loaded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (./usenix.sty (/usr/share/texlive/texmf-dist/tex/latex/psnfss/mathptmx.sty)) (/usr/share/texlive/texmf-dist/tex/latex/graphics/epsfig.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg) (/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
Read more
What are the differences between NUMA architecture and SMP architecture?
Posted onNUMA Architecture: Non-Uniform Memory Access architecture. SMP: Symmetric Multiprocessing architecture. In a Symmetric Multiprocessor, the architectural “distance” to any memory location is the same for all processors, i.e. “symmetric”. In a NonUniform Memory Access machine, each processor is “closer” to some memory locations than others; i.e. memory is partitioned among them Asymmetrically. From my understanding,
Read more
How to get a server’s serial number remotely?
Posted onHow to get a server’s serial number remotely? Tested on Linux Ubuntu 14.04 Trusty > sudo apt-get install dmidecode > sudo dmidecode -s system-serial-number I tried this on several Linux boxes with CentOS 7 and it seems A physical node returns a string like System Serial Number. A KVM VM returns a string like 3fd12bba-12d4-48c7-875a-7a5f57ed8a9a.
Read more
Why do I need to run latex/bibtex three times to make everything look good?
Posted onWhy does latex need to be executed 3 times like following? pdflatex main.tex bibtex main pdflatex main.tex pdflatex main.tex Copied from https://tex.stackexchange.com/questions/53235/why-does-latex-bibtex-need-three-passes-to-clear-up-all-warnings. The reason is as follows: 1, At the first latex run, all cite{…} arguments are written in the file document.aux. 2, At the bibtex run, this information is taken by bibtex and the
Read more
How can I login without password and run command in server at a local machine remotely?
Posted onLogin without PWD is fast and efficient. Running commands in server from local machine also have these benefits. login without PWD: add PC A’s public key to PC B’s authorized keys. > a@A:~> cat .ssh/id_rsa.pub | ssh b@B ‘cat >> .ssh/authorized_keys’ > b@B’s password: Run command remotely ssh root@MachineB “ls” NOTE: running commands remotely is
Read more
how to set linux date and time in commands
Posted onhow to set linux date and time in commands For example, to change date to 14 Nov 2017 11:57:00, the command would be, $ sudo date –set “14 Nov 2017 11:57:00” Tue Nov 14 11:57:00 HKT 2017
What is the difference between work conserving I/O scheduler and non-work conserving I/O scheduler?
Posted onWhat is the difference between work conserving I/O scheduler and non-work conserving I/O scheduler? In a work-conserving mode, the scheduler must choose one of the pending requests, if any, to dispatch, even if the pending requests are far away from the current disk head position. The rationale for non-work-conserving schedulers, such as the anticipatory scheduler
Read more
How to check interrupts lively in your systems?
Posted onI need to see what kind of interrupts are handled by which CPU. Please run command: # cat /proc/interrupts or you can execute $ watch -n1 “cat /proc/interrupts” to watch interrupts every 1 second. See [1] [2] for more details. References: [1] https://stackoverflow.com/questions/28301875/how-to-observe-interrupts-in-windows-or-linux-ubuntu-14-04 [2] http://www.linuxjournal.com/content/watch-live-interrupts
How to set one task’s CPU affinity quickly?
Posted onHow to set one task’s CPU affinity quickly? 1, Get this task’s ID # taskset -pc PID 2, Set this task’s CPU affinity # taskset -c affinity ./task There is also another format # taskset -pc affinity pid For example: set process with PID 3783 to CPU 15 # taskset -pc 15 3783
How to tune systems to achieve high performance in virtualization circumstances?
Posted onMost time, we need to tune system parameters to achieve better performance but what the general parameters to be tuned in Linux systems. I think you may want to add following parameters to Kernel boot (/etc/default/grub) parameters intel_idle.max_cstate=0 processor.max_cstate=0 idle=poll intel_pstate=disable At the same time, you may also want to shutdown/open Pause Loop Exiting (PLE).
Read more
How to limit a user’s CPU resources in Linux Systems
Posted onWhen you use a server with other users, you might want to limit other users’ CPU resources for some specific aims. Cgroup has lots of parameters we can use to control computer resources. For CPU resources, you can tune cpu.shares parameter to limit users’ CPU resources. To be more precise, change directory to /sys/fs/cgroup/cpu/user and
Read more
How to get vCPU thread ID in QEMU/KVM host OS?
Posted onIn order to collect more information about CPU information internal guest OS, we usually need to get vCPU’s thread ID in host OS. Solution 1: Under directory ‘/sys/fs/cgroup/cpuset/machine’, you will find virtual_machine_name.libvirt-qemu directory. And under this directory, you will find all vCPU sub-directories and under these dirs, you will find vCPU thread IDs. For example
Read more
For QEMU/KVM, how to share data between host and guest
Posted onGeneral question for developers to access data between VM and VMM. As I know, paravirtualization solution is a good way to share data for VM and VMM since it has better performance. Please use Virtio 9p solution for QEMU/KVM. Note that you need to load 9p related modules for guest kernel. Add following in your
Read more
How to get processes’ I/O utilization percentage
Posted onTwo notices: 1, a process has only one main thread which is itself. 2, a process has many threads. Solution 1: Please use taskstats [1] related interfaces, and send TASKSTATS_TYPE_PID and TASKSTATS_TYPE_TGID commands to kernel to get a process’s ‘blkio_delay_total’ parameter for a process with one main thread and a process with threads separately. Solution
Read more