Author: Bian Xi

Convert Oracle Linux 7.9 to Proxmox

Convert Oracle Linux 7.9 to Proxmox

This is to describe how to convert Oracle Linux 7.9 to Proxmox.

VM creation

Following hardware options can be considered

  • BIOS: SeaBIOS (Should be able to see Grub menu)
  • Machine: Default (i440fx)
  • SCSI Controller: VirtIO SCSI (It might not be used as sata0 to be considered for disk)
  • Hard Disk (sata0): disk_image_file
  • Network Device (net0): vmxnet3=<mac_address> (This is default for VMware, can use other type too)

Convert the VMware disk to Proxmox disk and attach the disk to new VM

qm importdisk 121 oracle18c.vmdk pool240ssd --format qcow2

Attach the disk as sata0.

Boot

Select item Oracle Linux Server (0-rescue-ed95572bd80641d79f83cd91e03c0283 with Linux) 7.9 from Grub menu to boot into rescue mode.

Note: Tried other option, all got error and unable to boot

Kernel

Find Kernel Package

Login as valid user, then find out the kernel to be used

rpm -q -a | grep kernel | sort

Got following list

kernel-3.10.0-1160.25.1.el7.x86_64
kernel-3.10.0-1160.36.2.el7.x86_64
kernel-3.10.0-1160.el7.x86_64
kernel-tools-3.10.0-1160.36.2.el7.x86_64
kernel-tools-libs-3.10.0-1160.36.2.el7.x86_64
kernel-uek-5.4.17-2102.203.6.el7uek.x86_64
kernel-uek-5.4.17-2102.204.4.2.el7uek.x86_64
kernel-uek-5.4.17-2102.204.4.4.el7uek.x86_64

Choose the latest one, which is also Unbreakable Enterprise Kernel

Recreate Grub kernel files

Find scripts in Kernel package

rpm -q kernel-uek-5.4.17-2102.204.4.4.el7uek.x86_64 --scripts

Following posttrans scriptlet shown

...
posttrans scriptlet (using /bin/sh):
/usr/sbin/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --update 5.4.17-2102.204.4.4.el7uek.x86_64 || exit $?
/usr/sbin/new-kernel-pkg --package kernel --rpmposttrans 5.4.17-2102.204.4.4.el7uek.x86_64 || exit $?
...

Run above commands to rebuild Grub files, then reboot the system to the menu with kernel recreated.

Note: The error Unable to open file: /etc/keys/x509_ima.der (-2) can be ignored

Network

You can reconfigure network interface the same as VMware, this is to avoid reconfiguration of network settings

Interface Type

Check VMWare vmx file to find disk type, then set the same in Proxmox

ethernet0.virtualDev = "vmxnet3"

Mac Address

You can change Mac Address using the value in VMWare configuration

ethernet0.generatedAddress = "00:11c:22:33:44:55"

Interface Name

Find out the interface in /etc/sysconfig/network-scripts as below.

/etc/sysconfig/network-scripts/ifcfg-ens192

The interface name is ifcfg-ens192

Create the file /etc/udev/rules.d/70-custom-ifnames.rules with the following contents:

SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="00:11:22:33:44:55",ATTR{type}=="1",NAME="ens192"

Then reboot the server, then check the Interface and IP address using ip a command.

References

Consistent network interface device naming

Remove orphan disks in Proxmox

Remove orphan disks in Proxmox

If you canceled disk movement in Proxmox, an orphaned disk will be created. In such case, it will not be shown in VM hardware configuration, and it can not be removed from storage session. If you try to remove it, you will have an error as the disk is attached to a VM.

In order to remove it, rescan disk is required.

Rescan

Use following command can make the orphan disk reattached to the VM.

qm rescan --vmid <vm_id>

*Note: rescan should be done in the Proxmox node which contains VM configuration, otherwise, could not find the VM configuration file error will appear.

References

https://forum.proxmox.com/threads/cancelled-disk-move-orphaned-disk.96650/

Detect and Fix Proxmox file integrity issue

Detect and Fix Proxmox file integrity issue

The files can be easily corrupted if the Proxmox OS is installed on an USB device.

Detection

Because Proxmox uses Debian system, run following command to detect corruption

# dpkg --verify
??5?????? c /etc/apt/sources.list.d/pve-enterprise.list
??5?????? c /etc/lvm/lvm.conf
??5?????? c /etc/issue
# 

Above files can be ignored as reason below.

  • /etc/apt/sources.list.d/pve-enterprise.list: Not using enterprise repo
  • /etc/lvm/lvm.conf: LVM configuration file contains system specific info, such as UUIDs
  • /etc/issue: This file contains IP address of host

Fix

Find out the packages

# dpkg -S <list of file_name>

Reinstall the packages

apt --reinstall install <list of package_name>

References

Fix ‘Briefly Unavailable for Scheduled Maintenance. Check Back in a Minute’ error

Fix ‘Briefly Unavailable for Scheduled Maintenance. Check Back in a Minute’ error

It happened after clicked refresh browser button when updating plugin.

Fix

Remove .maintenance file

References

How to Fix ‘Briefly Unavailable for Scheduled Maintenance. Check Back in a Minute’

Force `fsck` on reboot for Ubuntu 20.04

Force fsck on reboot for Ubuntu 20.04

The Maximum mount setting for ext4 file system can be used to enforce fsck to be executed on root file system.

Check current value

sudo tune2fs -l /dev/nvme0n1p2 | grep 'Maximum mount'

Note: Chances are this is set to -1 nowadays, disabling check based on the number of times the volume has been mounted.

Adjust the setting to 1 with the command:

sudo tune2fs -c 1 /dev/nvme0n1p2

References

How to force fsck on reboot for Ubuntu 20.04

Reduce size of folder `/var/log/journal` and `/var/cache/abrt-di` in Ubuntu

Reduce size of folder /var/log/journal and /var/cache/abrt-di in Ubuntu

/var/log/journal

Check disk usage

journalctl --disk-usage

Change configuration

Edit /etc/systemd/journald.conf

SystemMaxUse=50M

Restart service

systemctl restart systemd-journald.service

/var/cache/abrt-di

Check Max size of the log files

$ grep -i size /etc/abrt/abrt.conf 
# Max size for crash storage [MiB] or 0 for unlimited
MaxCrashReportsSize = 1000

Check Max size of /var/cache/abrt-di

$ grep -i DebugInfoCacheMB /etc/abrt/plugins/CCpp.conf
DebugInfoCacheMB = 2000

References

Can I remove files in /var/log/journal and /var/cache/abrt-di/usr?

Switch or Boot into Text Mode in Ubuntu

Switch or Boot into Text Mode in Ubuntu

Switch into Text mode

Press Ctrl+Alt+F3 to tty3 text console, and switch back via Ctrl+Alt+F2.

Boot into Text mode

  • Edit /etc/default/grub

    • Disable GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    • Set GRUB_CMDLINE_LINUX="text"
    • Set GRUB_TERMINAL="console" to disable graphical terminal.
  • Update grub by running command update-grub

  • Set system to multi user mode systemctl set-default multi-user.target

References

How to Boot Ubuntu 20.04 into Text / Command Console

Enable long file name in Windows 10 Pro

Enable long file name in Windows 10 Pro

To enable Windows 10 Pro support long file name, Group Policy needs to be modified.

Steps

  • Open the Group Policy Editor by run command gpedit.msc
  • Navigate to Computer Configuration => Administrative Templates => System => Filesystem.
  • Edit the policy Enable Win32 long paths.

How To Fix ‘Filename Is Too Long’ Issue In Windows

Upgrade DS1812+ RAM to 6GB

Upgrade DS1812+ RAM to 6GB

After I found there is an internal memory also can be replaced, I decided to try replace it with higher capacity memory.

Before

I got one 4GB memory and one 1GB default memory.

Swap

Because the default is not easy to reach and I'm not sure whether the slot is suitable for 4GB RAMs or not, so I swap two RAMs and boot.

Result: It works. Not the default memory slot has 4GB RAM in it.

Upgrade to 6GB

Then I replace the 1GB memory to 2GB as below.

root@ds1812:~# free
              total        used        free      shared  buff/cache   available
Mem:        6106616      576752      593516       16440     4936348     5115404
Swap:       2097084      166520     1930564
root@ds1812:~# cat /proc/meminfo
MemTotal:        6106616 kB
MemFree:          434420 kB
Buffers:            5968 kB
Cached:          4793912 kB
SwapCached:        18104 kB
Active:          1456104 kB
Inactive:        3398440 kB
Active(anon):      30672 kB
Inactive(anon):    40608 kB
Active(file):    1425432 kB
Inactive(file):  3357832 kB
Unevictable:        5560 kB
Mlocked:            5560 kB
SwapTotal:       2097084 kB
SwapFree:        1930572 kB
Dirty:             48688 kB
Writeback:             0 kB
AnonPages:         48644 kB
Mapped:            42632 kB
Shmem:             16448 kB
Slab:             289948 kB
SReclaimable:     113820 kB
SUnreclaim:       176128 kB
KernelStack:        9360 kB
PageTables:        44156 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     5150392 kB
Committed_AS:    1645472 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      465564 kB
VmallocChunk:   34359255664 kB
DirectMap4k:       16876 kB
DirectMap2M:     6262784 kB
root@ds1812:~#

References