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

The method of remounting data disk after initializing system disk in Linux instance

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

Share

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

I would like to share with you the method of remounting the data disk after initializing the Linux instance. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.

Remount the data disk after initializing the system disk of the Linux instance

In the Linux instance, reinitializing the system disk will not change the contents of the data disk, but the mount information of the data disk will be lost. Therefore, after Linux restart, follow the steps below to create a new mount point information and mount the data disk partition.

Note: in this document, it is assumed that before initializing the system disk, the partition name of the data disk mounted on the instance is / dev/vdb1, and the mount point name is / InitTest.

View data disk mount information: run the command mount. Returns information that there is no / dev/vdb1 in the result.

Sysfs on / sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on / proc type proc (rw,nosuid,nodev,noexec,relatime) devtmpfs on / dev type devtmpfs (rw,nosuid,size=497476k,nr_inodes=124369,mode=755) securityfs on / sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on / dev/shm type tmpfs (rw,nosuid,nodev) devpts on / dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on / run type tmpfs (rw,nosuid,nodev Mode=755) tmpfs on / sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755) cgroup on / sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) pstore on / sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) cgroup on / sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on / sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev Noexec,relatime,blkio) cgroup on / sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio,net_cls) cgroup on / sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on / sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on / sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime Hugetlb) cgroup on / sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) cgroup on / sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) cgroup on / sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids) cgroup on / sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) configfs on / sys/kernel/config type configfs (rw Relatime) / dev/vda1 on / type ext4 (rw,relatime,data=ordered) systemd-1 on / proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=9791) hugetlbfs on / dev/hugepages type hugetlbfs (rw,relatime) mqueue on / dev/mqueue type mqueue (rw,relatime) debugfs on / sys/kernel/debug type debugfs (rw,relatime) tmpfs on / run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=101620k,mode=700)

View data disk partition information: run the command fdisk-l.

Disk / dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x0008d73aDevice Boot Start End Blocks Id System/dev/vda1 * 2048 83884031 41940992 83 LinuxDisk / dev/vdb: 25.8 GB, 25769803776 bytes 50331648 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0xfe6d77c1Device Boot Start End Blocks Id System/dev/vdb1 2048 50331647 25164800 83 Linux

Recreate the mount point of the data disk partition: run the command

Mkdir / InitTest

Note: the mount point name here must be consistent with the mount point name of / dev/vdb1 before the initialization of the system disk. You can view the original mount point name through the cat / etc/fstab command.

Remount the data disk partition: run the command

Mount / dev/vdb1 / InitTest

View mount results: run the command

Df-h

Check whether / dev/vdb1 can be mounted automatically:

Uninstall / dev/vdb1: run the command

Umount / dev/vdb1

View mount information: run the command mount. If the uninstall is successful, there will be no information about / dev/vdb1 in the returned result.

Auto mount / dev/vdb1: run command

Mount-a

View mount information: run the command mount. If the automatic mount is successful, the / dev/vdb1 information will be returned in the result.

The above are all the contents of the method of remounting the data disk after initializing the system disk of the Linux instance. Thank you for your reading. I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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