Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Create a virtual hard disk using starwind and automatically mount it to centOS7 when it is booted

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Objective: to create a starwind virtual disk in the windows_server_2008_r2 system and mount it in / mnt in centOS7.

Tool: windows_server2008_r2.iso, click the download link: http://pan.baidu.com/s/1o8g9wU2 password: 3jf6

Click the download link for starwind network storage software: http://pan.baidu.com/s/1pKGiYy3 password: 9ktd

Step: after installing the windows_server2008_r2 system (the installation process is omitted), install the starwind storage software in it. Here we refer to http://jimshu.blog.51cto.com/3171847/590412/ directly for the installation steps.

Here I would like to thank the original author The fourth step in the original text is to use windows itself as a client, here we only need to refer to the first three steps.

Step 1: configure the network

Create the centOS7 system, and put the centOS7 system and the windows_server system in the local area network.

Step 2: install the scsi client Note: refer to http://www.thinksaas.cn/topics/0/609/609262.html here

Open the centOS7 terminal

Yum install-y iscsi-initiator-utils

Check to see if there are shared disks

Iscsiadm-mode discoverydb-type sendtargets-portal 192.168.80.12-discover

Note: this IP address is the address of the windows system, and what I show here is

Mount disk

Iscsiadm-mode node-targetname iqn.2008-08.com.starwindsoftware:127.0.0.1-storedisk1-portal 192.168.80.12 targetname iqn.2008 3260-login

After the mount is successful, there is a prompt:

Step 3: Mount to the / mnt directory

Fdisk-l

You can see

Create a folder first

Mkdir / mnt/store1

Mount-t ntfs / dev/sdc1 / mnt/store1

An error occurred:

Solution: solve the problem by using ntfs-3g

Open the download point of ntfs-3g: http://www.tuxera.com/community/open-source-ntfs-3g/

Download, or click the link: http://pan.baidu.com/s/1mhGpfb6 password: tmt7

Place the downloaded file in centOS

Perform the following steps to compile and install:

Install gcc first

Yum-y install gcctar zxvf ntfs-3g_ntfsprogs-2017.3.23.tgzcd ntfs-3g_ntfsprogs-2017.3.23./configuremakemake install

It should be all right after the installation.

Mount-t ntfs-3g / dev/sdc1 / mnt/store1df-h

You can see that it has been mounted!

However, if you restart centOS, you also need to reinstall the above steps for mounting. To do this, you need to write a script for boot self-starting mount.

There are two ways to set up boot mount:

Method 1 needs to be under root:

Vi / etc/rc.d/rc.local

Add content at the end

Iscsiadm-- mode node-- targetname iqn.2008-08.com.starwindsoftware:127.0.0.1-storedisk1-- portal 192.168.80.12 targetname iqn.2008 3260-- loginmount-t ntfs-3g / dev/sdc1 / mnt/store1

Then restart the system.

Method 2 is in the form of script

Vi / etc/rc.d/rc.local

Add content at the end

/ mnt/gzjb/autorun.sh

This is the absolute path to be executed at boot time

Then create the corresponding directory

Mkdir / mnt/gzjbvi / mnt/gzjb/autorun.sh

Add content to autorun.sh

#! / bin/bashiscsiadm-- mode node-- targetname iqn.2008-08.com.starwindsoftware:127.0.0.1-storedisk1-- portal 192.168.80.12 targetname iqn.2008 3260-- loginmount-t ntfs-3g / dev/sdc1 / mnt/store1

Ctrl+c,:wq save

Give file permissions

Chmod + x autorun.sh

Just restart it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report