Quickstarts > 7. Create and attach storage
In this learning module, you will learn how to enable and use storage services through the NHN Cloud console. NHN Cloud's storage servicesprovide a reliable and scalable solution for storing and managing your data.

In this learning module, you'll learn to

Final configuration diagram
To get started with NHN Cloud, you'll need to prepare the following things
This guide starts after step 6. Create and connect to the database.
Create a block storage, connect it to a Linux instance, and query the data in the block storage.
Attach the block storage resource
to theLinux instancelinux-server-basicthat you created in Module 3.
MyBSHDD10 GBis /dev/vda on linux-server-basicin the block storage list.MyBSand click Manage connectionsabove.linux-server-basiclinux-server-basic, run the command below to create a partition on theblock storage MyBScreated in step 1, and then format and mount it.#bash
echo -e "n\np\n1\n\n\nw" | sudo fdisk /dev/vdb
Tips
n: Create a new partition (optional: n)p: Select partition type (default: Primary)1: Partition number (default: 1)w: Save changes and exitsudo mkfs -t xfs /dev/vdb1
sudo mkdir /mnt/vdb
sudo sh -c 'echo "UUID=$(sudo blkid -s UUID -o value /dev/vdb1) /mnt/vdb xfs defaults,nodev,noatime,nofail 1 2" >> /etc/fstab'
sudo mount -a
sudo chmod 777 /mnt/vdb
df /dev/vdb1
Verify that the corresponding filesystem, capacity, and mount path are retrieved.

Output screen
linux-server-basic, run the command below to create block storage.export MYSQL_PWD=nhnpassword
mysql-db-basic data lookup in the block storage you created.mysql --host=(virtual IP address of mysql-db-basic instance) --user=nhncloud -e "SELECT * FROM employees.employees LIMIT 30;" -B --batch > /mnt/vdb/employees.csv
cat /mnt/vdb/employees.csv

Output screen
Enable the Object Storage service to create a container and upload objects to it. Save the object to your Linux instance and then connect to it to see if the data is output.
your MyPRJ project.myobsPUBLICStandardDisabledDisabled#PowerShell
mkdir /web-sample
echo '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>::: Welcome to NHN Cloud :::</title>
<script>
let countdownTimer;
function fetchServerIP() {
fetch("/server-info")
.then(response => response.json())
.then(data => {
const serverIP = data.serverIP;
document.getElementById("server-ip").innerText = "Server IP Address: " + serverIP;
})
.catch(error => {
document.getElementById("server-ip").innerText = "Unable to fetch server IP address";
});
}
function startStressTest() {
const button = document.getElementById("start-btn");
button.innerText = "Starting...";
let timeLeft = 120;
const countdownDisplay = document.getElementById("countdown");
countdownDisplay.innerText = "Time left: " + timeLeft + " seconds";
countdownTimer = setInterval(() => {
timeLeft--;
countdownDisplay.innerText = "Time left: " + timeLeft + " seconds";
if (timeLeft <= 0) {
clearInterval(countdownTimer);
countdownDisplay.innerText = "Stress test complete!";
}
}, 1000);
fetch("/start-stress")
.then(response => response.text())
.then(data => {
console.log(data);
})
.catch(error => {
console.error("Error starting stress test:", error);
});
}
window.onload = fetchServerIP;
</script>
</head>
<body>
<h1>Welcome to NHN Cloud Web Server</h1>
<p id="server-ip">Fetching server IP address...</p>
<button id="start-btn" onclick="startStressTest()">Start Stress Test</button>
<p id="countdown">Time left: 120 seconds</p>
</body>
</html>' > /web-sample/index.html
myobsto go to the container details page screen.myobs screen, click Upload object.the index.html file located in /web-sample, and then click OK.index.html file upload status is Success, and then click OK.index.html object, in the Public URL entry, click Copy URLto copy the public URL address of the index.html file.to linux-server-basic.[Note] How to remotely connect
to linux-server-basic
- For how to connect remotely, see 4. Set up your network and create an instance - Step 1. SSH remote access.
the linux-server-basic remote, run the command below to download and save index.html.sudo curl -o /var/www/html/index.html (Public URL of the index.html file you uploaded to myobs)
Tips
is /var/www/html. The web page documentation output when connecting to the http://복사한 linux-server-basic floating IP addressis /var/www/html/index.html.curl -s https://kr2-api-object-storage.nhncloudservice.com/v1/AUTH_cd41d4b57c1346b99641cc4092f2842d/onboarding/service-setting.sh | sed 's/\r$//' > /home/ubuntu/service-setting.sh
chmod +x /home/ubuntu/service-setting.sh
/home/ubuntu/service-setting.sh
http://복사한 linux-server-basic floating IP addressto see the changed web page.

Tips
Ctrl + F5 or Shift + F5Cmd + Shift + R