-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathebs attach detach
More file actions
81 lines (58 loc) · 1.22 KB
/
ebs attach detach
File metadata and controls
81 lines (58 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Step 1: Gain root access
sudo su
Step 2: List available disks
lsblk
Step 3: View disk details
fdisk -l
Step 4: Open disk for partitioning
fdisk /dev/xvdb
Step 5: Inside fdisk
m
n
p
(press Enter)
(press Enter)
(press Enter)
w
Step 6: Refresh partition table
partprobe
Step 7: Check partition and filesystem
lsblk -fs
Step 8: Format the partition
mkfs.xfs /dev/xvdb1
Step 9: Verify formatting
lsblk -fs
Step 10: Create mount folder
mkdir /mnt/csee589
Step 11: Mount the partition
mount /dev/xvdb1 /mnt/csee589
Step 12: Verify mount
lsblk -fs
Step 13: Go to mount folder
cd /mnt/csee589
Step 14: Create test files
touch files1 files2 files3 files4 files5 files6 files7 files8 files9 files10
Step 15: Check files
ls
Step 16: Go back to root
cd /
Step 17: Make mount permanent
vi /etc/fstab
(add this line at the bottom)
/dev/xvdb1 /mnt/csee589 xfs defaults 0 0
(press Esc, then :wq, then Enter)
Step 18: Verify again
lsblk -fs
Step 19: Go to mount folder again
cd /mnt/csee589
Step 20: Check files again
ls
Step 21: Go back to root
cd /
Step 22: Unmount the partition
umount /mnt/csee589
Step 23: Check if unmounted
cd /mnt/csee589
ls
Final Step: Detach volume
Go to AWS EC2 → Volumes → Select volume → Actions → Detach Volume