我正在运行全新安装的 Ubuntu 18.04.3 LTS 的虚拟机,该虚拟机有一个 34 GB 的分区。
首先,我使用 cfdisk 将分区大小调整为 24gb,然后创建一个 10gb 的分区。
然后我尝试在新分区上创建一个文件系统。这样做会导致文件系统变为只读
pj@ubuntu:/$ mkfs -v -t ext4 /dev/sda2
mke2fs 1.44.1 (24-Mar-2018)
Could not open /dev/sda2: Permission denied
pj@ubuntu:/$ sudo !!
sudo mkfs -v -t ext4 /dev/sda2
mke2fs 1.44.1 (24-Mar-2018)
fs_types for mke2fs.conf resolution: 'ext4'
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621184 blocks
131059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2151677952
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Filesystem UUID: af601173-c7e3-4386-9eab-f9926454509a
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
pj@ubuntu:/$ touch /file2
touch: cannot touch '/file2': Read-only file system
当我重启电脑时,我进入了 grub rescue。为什么会发生这种情况?