• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. Private Image Creation Guide (BMS)
  4. Creating a Linux Image
  5. Deleting Files

Deleting Files

Deleting Uploaded Files

Delete files that have been uploaded to the VM, such as the rpm software packages of bms-network-config and the SDI card driver.

Deleting Temporary Files

  • Run the following commands to delete temporary files:

    rm -rf /var/log/cloud-init*

    rm -rf /var/lib/cloud/*

    rm -rf /var/log/network-config.log

  • Run the following commands to delete the remaining configuration information:
    • For SUSE OS:

      Check which files start with ifcfg under the /etc/sysconfig/network/ folder, and delete files starting with ifcfg other than ifcfg-lo.

      The command to view the file: ll /etc/sysconfig/network/

      The command to delete the file: rm -rf /etc/sysconfig/network/ifcfgxxx

    • For Red Hat, CentOS, Oracle and Euler OS:

      Check which files start with ifcfg under the /etc/sysconfig/network-scripts/ folder, and delete files starting with ifcfg other than ifcfg-lo.

      The command to view the file: ll /etc/sysconfig/network-scripts/

      The command to delete the file: rm -rf /etc/sysconfig/network-scripts/ifcfgxxx

    • For Ubuntu OS: rm -rf /etc/network/interfaces.d/50-cloud-init.cfg
  • Run the following commands to delete historical operation records:

    history -w;echo > /root/.bash_history;history-c;history -c;history -c;