May 29

How to find out maximum supported RAM in Ubuntu/ArchLinux

f you need a quick way to find out how much RAM your Linux system supports or to determine the number of DIMM slots available, you can use a command line tool called dmidecode.

dmidecode command is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. Thanks to this table, you can retrieve this information without having to probe for the actual hardware.

# archlinux
yaourt -S dmidecode

# ubuntu
sudo apt-get install dmidecode

To find out the maximum RAM capacity and the number of RAM slots available, use the following command:

sudo dmidecode -t 16

The Maximum Capacity is the maximum RAM supported by your system, while Number of Devices is the number of memory (DIMM) slots available on your computer.

To see complete memory information, including the info above along with currently installed memory information (RAM speed, size, etc.), use:

sudo dmidecode -t memory

Original article is stored here

May 29

FSCK and multi partition mount from disk image file

root@nodes:~# kpartx -v -a /dev/pve/vm-104-disk-0
add map pve-vm--104--disk--0p1 (252:6): 0 2048 linear 252:8 2048
add map pve-vm--104--disk--0p2 (252:12): 0 3715072 linear 252:8 4096
add map pve-vm--104--disk--0p3 (252:13): 0 38221824 linear 252:8 3719168

mount /dev/mapper/pve-vm--104--disk--0p1 /mnt/

kpartx -dv /dev/pve/vm-104-disk-0

Helpful links:
https://superuser.com/questions/211338/how-to-mount-a-multi-partition-disk-image-in-linux