To create a new storage device and move the files:
- Log in to the SSFE server via SSH.
- Get the root permission.
safesync@appliance1:~$sudo su -
root@appliance1:~# - Enter the command below and take a snapshot of the total number of files.
mogstats
- Add a new virtual disk to a virtual machine.
- Right-click a virtual machine and select Properties.
- Click the Add button.
- Choose Hard Disk to add a new virtual disk.
- Go to Administration > Storage Management.
- Click Add and select Local Disk, then click Next.
- On the command line interface, run the following to stop the deviceChecker in /etc/crontab.
sed -i '/deviceChecker/s/^/# /' /etc/crontab
- Ensure that the deviceChecker has comment using the command below:
cat /etc/crontab
- Set the $target_dev_id and the $hostname to be drained (e.g. target_id_dev=11 , hostname= appliance1).
target_dev_id=11 && ( [ "$target_dev_id" = "ID" ] && echo "please enter the valid target_dev_id" ) || ( [ "$(hostname)" = "appliance1" ] && s_host="osdp-store1" || s_host="osdp-store2" && mogadm device mark $s_host $target_dev_id drain) 2> /dev/null
- Run the following command and wait for the status to reach 100%. The process may take some time.
mogadm fsck reset && mogadm fsck start watch -n 1 mogadm fsck status
- Run the command below to check if the file number of the drained device is close to zero (0).
watch -n 1 'stats=$(mogstats 2> /dev/null) && last=$(echo "$stats" | grep -n "Statistics for file ids" | cut -d":" -f1) && echo "$stats" | sed -n "1,${last}p"'
- Enter the following command to check if all the files have been moved. Compare the file count with the snapshot taken in step 3.
mogstats
- Delete the drained device using the appropriate procedure below:
Make sure to replace "dev$devid" with the dev id of your drained device.
- For local storage type, run /opt/SingleInstaller/nodeControl/bin/mount-local.bash --dead dev$devid
- For iscsi storage type, run /opt/SingleInstaller/nodeControl/bin/mount-iscsi.bash --dead dev$devid
- Restore the deviceChecker in /etc/crontab using the command below:
sed -i '/deviceChecker/s/# //' /etc/crontab
- Make sure the deviceChecker has uncomment using the command below:
cat /etc/crontab