首先,我是新手SE。
现在,我尝试使用连接到一个实例的两个磁盘。
一个仅用于操作系统,另一个用于日志数据等。
因此,我使用SSD PD 20 sdb(/dev/sda)和SSD PD 100 sdb(/dev/sdb)启动了计算引擎。
我使用fdsik命令将/dev/sdb分区到3个逻辑分区中的1个扩展分区。
之后,我制作了文件系统并挂载它。
[johndoe@my-instance ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 8.5M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda2 20G 2.1G 18G 11% /
/dev/sda1 200M 12M 189M 6% /boot/efi
/dev/sdb5 20G 45M 20G 1% /MY_PARTION_svc
/dev/sdb6 20G 45M 20G 1% /MY_PARTION_app
/dev/sdb7 50G 53M 50G 1% /MY_PARTION_log
tmpfs 3.2G 0 3.2G 0% /run/user/1000我想从这个vm (包括磁盘分区配置)中创建自定义映像,用于自动伸缩。
因此,我创建了一个自定义映像并使用该映像启动了一个新实例,但是当我通过串行控制台查看引导过程时,挂载失败。
查看串行控制台,在分区操作中有一个将设备UUID和目录映射到/etc/fstab文件的过程,但这对于每个实例都是不同的,因此似乎发生了一个错误。
然后,对于使用额外分区磁盘的实例,我想知道如何使用我想要安装的包创建自定义映像。(用于自动缩放)。
英语不是我的母语,我也不熟悉Linux,所以我想知道我的问题是否正确。
串口控制台在这里
Welcome to [0;31mCentOS Linux 7 (Core)[0m!
[[32m OK [0m] Stopped Switch Root.
[[32m OK [0m] Stopped Journal Service.
Starting Journal Service...
Starting Create list of required st... nodes for the current kernel...
[[32m OK [0m] Started Forward Password Requests to Wall Directory Watch.
Starting Read and set NIS domainname from /etc/sysconfig/network...
Mounting POSIX Message Queue File System...
[[32m OK [0m] Reached target Remote File Systems.
Mounting Huge Pages File System...
[[32m OK [0m] Reached target Local Encrypted Volumes.
[[32m OK [0m] Stopped File System Check on Root Device.
[[32m OK [0m] Listening on /dev/initctl Compatibility Named Pipe.
[[32m OK [0m] Set up automount Arbitrary Executab...ats File System Automount Point.
[[32m OK [0m] Listening on Delayed Shutdown Socket.
[[32m OK [0m] Reached target Swap.
[[32m OK [0m] Created slice system-getty.slice.
[[32m OK [0m] Listening on udev Kernel Socket.
[[32m OK [0m] Created slice User and Session Slice.
[[32m OK [0m] Reached target Slices.
[[32m OK [0m] Created slice system-systemd\x2dfsck.slice.
Mounting Debug File System...
[[32m OK [0m] Stopped target Switch Root.
[[32m OK [0m] Stopped target Initrd Root File System.
[[32m OK [0m] Stopped target Initrd File Systems.
[[32m OK [0m] Created slice system-selinux\x2dpol...grate\x2dlocal\x2dchanges.slice.
[[32m OK [0m] Reached target Paths.
[[32m OK [0m] Created slice system-serial\x2dgetty.slice.
Starting Remount Root and Kernel File Systems...
Starting Apply Kernel Variables...
[[32m OK [0m] Listening on udev Control Socket.
[[32m OK [0m] Started Create list of required sta...ce nodes for the current kernel.
Starting Create Static Device Nodes in /dev...
[[32m OK [0m] Started Journal Service.
[[32m OK [0m] Mounted Debug File System.
[[32m OK [0m] Mounted POSIX Message Queue File System.
[[32m OK [0m] Mounted Huge Pages File System.
[[32m OK [0m] Started Remount Root and Kernel File Systems.
Starting Configure read-only root support...
Starting Flush Journal to Persistent Storage...
Starting udev Coldplug all Devices...
[[32m OK [0m] Started Apply Kernel Variables.
[[32m OK [0m] Started Read and set NIS domainname from /etc/sysconfig/networ[ 3.649595] systemd-journald[354]: Received request to flush runtime journal from PID 1
k.
[[32m OK [0m] Started Flush Journal to Persistent Storage.
[[32m OK [0m] Started Create Static Device Nodes in /dev.
Starting udev Kernel Device Manager...
[[32m OK [0m] Reached target Local File Systems (Pre).
[[32m OK [0m] Started Configure read-only root support.
Starting Load/Save Random Seed...
[[32m OK [0m] Started udev Coldplug all Devices.
[[32m OK [0m] Started Load/Save Random Seed.
[[32m OK [0m] Started udev Kernel Device Manager.
[[32m OK [0m] Found device /dev/ttyS0.
[ 3.783238] input: PC Speaker as /devices/platform/pcspkr/input/input4
[ 3.791222] piix4_smbus 0000:00:01.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
[ 3.822070] cryptd: max_cpu_qlen set to 1000
[ 3.825563] random: crng init done
[ 3.834624] sd 0:0:1:0: Attached scsi generic sg0 type 0
[ 3.836191] sd 0:0:2:0: Attached scsi generic sg1 type 0
[ 3.894958] AVX2 version of gcm_enc/dec engaged.
[ 3.897714] AES CTR mode by8 optimization enabled
[ 3.937510] alg: No test for __gcm-aes-aesni (__driver-gcm-aes-aesni)
[ 3.940198] alg: No test for __generic-gcm-aes-aesni (__driver-generic-gcm-aes-aesni)
%G[ 4.022204] ppdev: user-space parallel port driver
[[32m OK [0m] Found device PersistentDisk 7.
Starting File System Check on /dev/...5-bfce-4da9-b385-04e4d318c27c...
[[32m OK [0m] Found device PersistentDisk 5.
Starting File System Check on /dev/...a-1992-46e1-abc0-1d54a75e2c02...
[[32m OK [0m] Found device PersistentDisk 6.
[[32m OK [0m] Found device PersistentDisk EFI\x20System\x20Partition.
Mounting /boot/efi...
Starting File System Check on /dev/...d-1679-4797-955c-679e40d3d8b8...
[ 4.086204] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[[32m OK [0m] Mounted /boot/efi.
[ 3.147471] systemd-fsck[471]: /dev/sdb5: recovering journal
[ 3.149702] systemd-fsck[477]: /dev/sdb6: recovering journal
[ 3.149993] systemd-fsck[469]: /dev/sdb7: recovering journal
[ 3.162412] systemd-fsck[471]: /dev/sdb5: clean, 11/1310720 files, 126322/5242880 blocks
[ 3.163353] systemd-fsck[477]: /dev/sdb6: clean, 11/1310720 files, 126322/5242880 blocks
[ 3.166552] systemd-fsck[469]: /dev/sdb7: clean, 11/3276800 files, 251790/13107200 blocks
[[32m OK [0m] Started File System Check on /dev/d...aca-1992-46e1-abc0-1d54a75e2c02.
[[32m OK [0m] Started File System Check on /dev/d...0ed-1679-4797-955c-679e40d3d8b8.
Mounting /svc...
Mounting /app...
[[32m OK [0m] Started File System Check on /dev/d...6d5-bfce-4da9-b385-04e4d318c27c.
Mounting /log...
[ 4.181269] EXT4-fs (sdb6): Unrecognized mount option "NOFAIL_OPTION" or missing value
[[1;31mFAILED[0m] Failed to mount /svc.
See 'systemctl status svc.mount' for[ 4.191837] EXT4-fs (sdb5): Unrecognized mount option "NOFAIL_OPTION" or missing value
[ 4.192163] EXT4-fs (sdb7): Unrecognized mount option "NOFAIL_OPTION" or missing value
details.
[[1;33mDEPEND[0m] Dependency failed for Local File Systems.
[[1;33mDEPEND[0m] Dependency failed for Migrate local... structure to the new structure.
[[1;33mDEPEND[0m] Dependency failed for Mark the need to relabel after reboot.
[[1;33mDEPEND[0m] Dependency failed for Relabel all filesystems, if necessary.
[[32m OK [0m] Reached target Timers.
[[32m OK [0m] Reached target Login Prompts.
[[32m OK [0m] Reached target Network (Pre).
[[32m OK [0m] Reached target Network.
[[32m OK [0m] Reached target Sockets.
Starting Resize root filesystem if needed...
Starting Create Volatile Files and Directories...
Starting Tell Plymouth To Write Out Runtime Data...
[[32m OK [0m] Started Emergency Shell.
[[32m OK [0m] Reached target Emergency Mode.
[[32m OK [0m] Reached target Network is Online.
[[1;31mFAILED[0m] Failed to mount /log.
See 'systemctl status log.mount' for details.
[[1;31mFAILED[0m] Failed to mount /app.
See 'systemctl status app.mount' for details.
[[32m OK [0m] Started Tell Plymouth To Write Out Runtime Data.
[[32m OK [0m] Started Create Volatile Files and Directories.
Starting Security Auditing Service...
[[32m OK [0m] Started Resize root filesystem if needed.
[ 4.275787] type=1305 audit(1606957692.773:4): audit_pid=521 old=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1
[[32m OK [0m] Started Security Auditing Service.
Starting Update UTMP about System Boot/Shutdown...
[[32m OK [0m] Started Update UTMP about System Boot/Shutdown.
Starting Update UTMP about System Runlevel Changes...
[[32m OK [0mWelcome to emerg
Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.发布于 2020-12-03 21:22:26
在深入了解操作系统/硬件细节之前,我尝试重现您的问题。
我已经设置了一个新的CentOS 7实例,其中包含20 up系统盘和额外的100 up盘。然后我登录并创建了一个扩展的100 in分区,其中有三个逻辑分区:
Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xd237855b
Device Boot Start End Blocks Id System
/dev/sdb1 2048 209715199 104856576 5 Extended
/dev/sdb5 4096 41947135 20971520 83 Linux
/dev/sdb6 41949184 83892223 20971520 83 Linux
/dev/sdb7 83894272 209715199 62910464 83 Linux然后我停止了虚拟机,创建了它的镜像(使用默认设置)。然后在此基础上,我创建了一个新的VM实例(进程创建了一个新的20 it系统盘和另一个100 it的数据)。它启动正常,我可以通过SSH登录。分区在fdisk中是可见的。
我的例子和你的例子之间唯一的区别是,你在创建Image之前已经安装了你的paritions。我没有。
尝试再次创建一个映像并从中创建一个新的VM -您可能遇到了一些错误,因此请重试。
https://stackoverflow.com/questions/65103513
复制相似问题