linux:presun_var_na_jine_misto

Toto je starší verze dokumentu!


How to move or relocate /var folder to a new partition in Linux This document (7015338) is provided subject to the disclaimer at the end of this document.

To relocate or move the /var folder to a new partition in Linux, please follow the steps below:

* Add a new hard disk to the server.

Note: If this is a virtual machine, see how to add a new virtual hard disk to the VM with a corresponding vendor.

Mount the new filesystem in /mnt, from YaST: Launch YaST, select Partitioner | expand Hard Disks | select Add Partition… New Partition Type: Primary Partition Select Maximum Size, if preferred. Formatting Options: ext3 (default) Mounting Options: Mount Partition and specify Mount Point as /mnt/newvar Note: If there is a problem, the directory may need to be created first. Select Finish and then Next.

Switch to single-user mode: init 1 Note: This will reboot the server into single-user mode where services aren't started and networking is offline for the server. Please login as root when the login dialog is presented and proceed to open a terminal window.

Copy the data in var only to the new mounted filesystem: cp -apx /var/* /mnt/newvar

Rename the current /var directory for backup purposes: mv /var /var.old

Make the new var directory: mkdir /var

Edit the /etc/fstab file: Replace /mnt/newvar with /var Save and Close the file. Note: The new partition is now configured to be mounted at /var on boot.

Restart the server.

  • linux/presun_var_na_jine_misto.1653979903.txt.gz
  • Poslední úprava: 2022/05/31 08:51
  • autor: badtotem