You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/block-storage/api-cli/managing-a-volume.mdx
-166Lines changed: 0 additions & 166 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,173 +18,7 @@ This documentation only explains how to mount **additional block volumes to your
18
18
- An [Instance](/instances/concepts/#instance)
19
19
-[Attached](/block-storage/how-to/attach-a-volume/) an additional Block Storage volume to your Instance
20
20
21
-
## Mounting and using a Block Storage volume
22
21
23
-
In order to mount and use your Block Storage volume, you need to connect to the Instance it is attached to, via SSH.
24
-
Then, check that the volume is available, format it, and mount it following the instructions below.
25
-
26
-
### Verifying device availability
27
-
28
-
1. Connect to your Instance with `ssh`.
29
-
```
30
-
ssh root@<your_instance_ip>
31
-
```
32
-
2. Use the `lsblk` command to confirm that your block volume is available:
33
-
```
34
-
lsblk
35
-
```
36
-
37
-
You should see an output similar to the following. The root Block volume `sda`, contains your OS. The Block volume named `sdb` is the one we will be mounting to the Instance.
38
-
39
-
```sh no-copy
40
-
root@scw-festive-agnesi:~# lsblk
41
-
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
42
-
sda 8:0 0 18.6G 0 disk
43
-
├─sda1 8:1 0 18.5G 0 part /
44
-
├─sda14 8:14 0 4M 0 part
45
-
└─sda15 8:15 0 106M 0 part /boot/efi
46
-
sdb 8:16 0 27.9G 0 disk
47
-
```
48
-
49
-
<Messagetype="note">
50
-
The Scaleway ecosystem uses [GB](https://en.wikipedia.org/wiki/Gigabyte) to define storage sizes and not [GiB](https://en.wikipedia.org/wiki/Gibibyte) as the default on linux.
51
-
</Message>
52
-
53
-
### Formatting the Block volume
54
-
55
-
Formatting your volume prepares it for storing files.
56
-
57
-
<Messagetype="important">
58
-
The procedure below describes how to format your volume using the `mkfs` command, which will **erase all data on the volume**.
59
-
</Message>
60
-
61
-
1. Create a file system with the following command. This command uses the `ext4` file system, though you can choose another if you prefer.
62
-
```
63
-
# Make sure that you replace `/dev/sdX` with the name of your volume
64
-
mkfs.ext4 /dev/sdX
65
-
```
66
-
2. Run the following command to check if your file system was correctly created.
67
-
```
68
-
lsblk -f
69
-
```
70
-
71
-
You should see an output like the following. Check that the `FSTYPE` field matches `ext4` for your Block volume. In this example, we have formatted the `sdb` volume.
72
-
73
-
```sh no-copy
74
-
root@scw-festive-agnesi:~# lsblk -f
75
-
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
### Creating the mount point and mounting the Block volume
90
-
91
-
Once you have created your file system, you need to define where you want to mount your volume, and create a mount point (directory) for it.
92
-
93
-
1. Create the mount point. You can replace `block-volume` with another name for your mount point.
94
-
```
95
-
mkdir /mnt/block-volume
96
-
```
97
-
2. Mount the volume. We recommend that you use the `defaults` option, as in the command below.
98
-
```
99
-
# Replace sdX with the name of your volume
100
-
mount -o defaults /dev/sdX /mnt/block-volume
101
-
```
102
-
103
-
If you want to see all available options, you can run `man mount` on your Instance.
104
-
105
-
3. Run the following command to check if your volume was properly mounted:
106
-
```
107
-
lsblk
108
-
```
109
-
110
-
You should see an output like the following. Check the `MOUNTPOINT` field.
111
-
112
-
```sh no-copy
113
-
root@scw-festive-agnesi:~# lsblk
114
-
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
115
-
sda 8:0 0 18.6G 0 disk
116
-
├─sda1 8:1 0 18.5G 0 part /
117
-
├─sda14 8:14 0 4M 0 part
118
-
└─sda15 8:15 0 106M 0 part /boot/efi
119
-
sdb 8:16 0 27.9G 0 disk /mnt/block-volume
120
-
```
121
-
122
-
The `sdb` volume is mounted at `/mnt/block-volume`.
123
-
124
-
---
125
-
126
-
### Using fstab for Persistent Mounting
127
-
128
-
With the current configuration, your volume will not be mounted automatically upon reboot. Use the `/etc/fstab` file to ensure the reboot does not impact your file system.
129
-
130
-
Run the following command to make sure your volume is automatically mounted to your Instance upon reboot. You must replace `sdX` with your volume.
131
-
132
-
```
133
-
echo "UUID=$(blkid --output value /dev/sdX | head -n1) /mnt/block-volume ext4 defaults 0 0" >> /etc/fstab
134
-
```
135
-
136
-
---
137
-
138
-
### Transferring data from your local machine to the remote Block volume
139
-
140
-
You can transfer files from your local machine to your Instance's remote Block volume with [rsync](https://en.wikipedia.org/wiki/Rsync), a tool for efficiently transferring and copying files. The rsync utility is pre-installed on most Linux distributions and macOS.
141
-
142
-
1. Check that rsync is installed on your local machine with the following command:
143
-
```
144
-
rsync --version
145
-
```
146
-
147
-
An output similar to the following displays:
148
-
149
-
```sh no-copy
150
-
rsync version 3.1.3 protocol version 31
151
-
Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others.
152
-
Web site: http://rsync.samba.org/
153
-
Capabilities:
154
-
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
159
-
are welcome to redistribute it under certain conditions. See the GNU
160
-
General Public Licence for details.
161
-
```
162
-
163
-
<Messagetype="tip">
164
-
If you get a `command not found` output (or similar), you need to install `rsync`:
165
-
- On Linux Ubuntu and Debian systems, you can do this with the APT package tool using the `sudo apt install rsync` command.
166
-
- For Linux CentOS/ Fedora, you can use the YUM package manager: `sudo yum install rsync`.
167
-
- On Mac OSX with the Homebrew package manager, you can use `brew install rsync`.
168
-
</Message>
169
-
170
-
2. On your local machine, open a new terminal and use the following command to create a file called `hello-world.txt`:
171
-
```
172
-
nano hello-world.txt
173
-
```
174
-
175
-
3. Enter the text `Hello World!`.
176
-
177
-
4. Press `Ctrl+O`, then `Enter`, then `Ctrl+X` to save and exit the file.
178
-
179
-
5. Enter the following command to transfer the file to your Instance's mounted block volume. Ensure that you use your own Instance's IP address:
180
-
181
-
```
182
-
rsync -a hello-world.txt root@<your_instance_ip>:/mnt/block-volume
183
-
```
184
-
185
-
The file is now transferred. You can connect to your Instance again, and use the command `cd /mnt/block-volume ; ls` to check that the file appears in the directory.
186
-
187
-
---
188
22
189
23
## Increasing the partition size of the volume with growpart
You can transfer files from your local machine to your Instance's remote Block volume with [rsync](https://en.wikipedia.org/wiki/Rsync), a tool for efficiently transferring and copying files. The rsync utility is pre-installed on most Linux distributions and macOS.
12
+
13
+
<Requirements />
14
+
15
+
- A Scaleway account logged into the [console](https://console.scaleway.com)
16
+
-[Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
17
+
- An [Instance](/instances/concepts/#instance)
18
+
-[Attached](/block-storage/how-to/attach-a-volume/) a Block Storage volume to your Instance
19
+
20
+
1. Check that rsync is installed on your local machine with the following command:
21
+
```
22
+
rsync --version
23
+
```
24
+
25
+
An output similar to the following displays:
26
+
27
+
```sh no-copy
28
+
rsync version 3.1.3 protocol version 31
29
+
Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others.
30
+
Web site: http://rsync.samba.org/
31
+
Capabilities:
32
+
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
37
+
are welcome to redistribute it under certain conditions. See the GNU
38
+
General Public Licence for details.
39
+
```
40
+
41
+
<Messagetype="tip">
42
+
If you get a `command not found` output (or similar), you need to install `rsync`:
43
+
- On Linux Ubuntu and Debian systems, you can do this with the APT package tool using the `sudo apt install rsync` command.
44
+
- For Linux CentOS/ Fedora, you can use the YUM package manager: `sudo yum install rsync`.
45
+
- On Mac OSX with the Homebrew package manager, you can use `brew install rsync`.
46
+
</Message>
47
+
48
+
2. On your local machine, open a new terminal and use the following command to create a file called `hello-world.txt`:
49
+
```
50
+
nano hello-world.txt
51
+
```
52
+
53
+
3. Enter the text `Hello World!`.
54
+
55
+
4. Press `Ctrl+O`, then `Enter`, then `Ctrl+X` to save and exit the file.
56
+
57
+
5. Enter the following command to transfer the file to your Instance's mounted block volume. Ensure that you use your own Instance's IP address:
58
+
59
+
```
60
+
rsync -a hello-world.txt root@<your_instance_ip>:/mnt/block-volume
61
+
```
62
+
63
+
The file is now transferred. You can connect to your Instance again, and use the command `cd /mnt/block-volume ; ls` to check that the file appears in the directory.
Unmounting a volume means detaching it from the operating system so it is no longer accessible. You can do this if you want to stop using it, prevent data corruption, or plan to [detach it](/block-storage/how-to/detach-a-volume/) from your Instance and attach it to another. This page shows you how to unmount a volume from the operating system using the `umount` command.
You can attach up to **15 volumes** at a time to a single Instance. You can attach a Block Storage volume to your Instance at any time, as long as they are both in the same [Availability Zone](/instances/concepts/#availability-zone).
0 commit comments