Linux虚拟磁盘挂载错误,不能进入系统(fsck.ext3:no such file directory)

亦余心之所善兮,虽九死其犹未悔。这篇文章主要讲述Linux虚拟磁盘挂载错误,不能进入系统(fsck.ext3:no such file directory)相关的知识,希望能为你提供帮助。



【Linux】虚拟磁盘挂载错误,不能进入系统(fsck.ext3:no such file directory while trying to open /dev/xxx)







重新挂载根分区:mount -o remount,rw /? ?




Linux虚拟磁盘挂载错误,不能进入系统(fsck.ext3:no such file directory)

文章图片

错误如图中FAILED所示,这种错误一般因挂载了没有建立分区的磁盘所致,只要进入系统之后对新建的磁盘分区(见后续内容),重新加载即可,现在的问题是如何重新进入系统,对新建的磁盘建立分区。


重新进入系统的方法: 系统加载失败之后将进入维修系统,按理来说我们可以在维修系统下修改磁盘挂载配置文件/etc/fstab, ?去掉加载失败磁盘对应的配置选项?,但是由于系统刚启动时,以只读方式加载根文件系统,因此我们根本就无法修改配置文件/etc/fstab,当然通过命令? mount -o remount,rw / ?重新以读写方式挂载根文件系统即可。


新建磁盘分区方法:
fdisk -l
得到当前系统的磁盘列表,如下图所示:
Linux虚拟磁盘挂载错误,不能进入系统(fsck.ext3:no such file directory)

文章图片

见图中提示 /dev/sdh doesnt contain a valid partition table
新建分区步骤(见黑色标注字体):
1、 fdisk /dev/sdh




Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x76072764.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content wont be recoverable.




The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)


Command (m for help): m
Command action
atoggle a bootable flag
bedit bsd disklabel
ctoggle the dos compatibility flag
ddelete a partition
llist known partition types
mprint this menu
nadd a new partition
ocreate a new empty DOS partition table
pprint the partition table
qquit without saving changes
screate a new empty Sun disklabel
tchange a partitions system id
uchange display/entry units
vverify the partition table
wwrite table to disk and exit
xextra functionality (experts only)


Command (m for help): n
Command action
eextended
pprimary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305


Command (m for help): p


Disk /dev/sdh: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
【Linux虚拟磁盘挂载错误,不能进入系统(fsck.ext3:no such file directory)】 Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x76072764


Device BootStartEndBlocksIdSystem
/dev/sdh1113051048238183Linux


Command (m for help): w 写入分区表
The partition table has been altered!


Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost sDK-ixp422-bqh]# mkfs.ext3 /dev/sdh1 格式化分区
mke2fs 1.40.2 (12-Jul-2007)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1310720 inodes, 2620595 blocks
131029 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632


Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done


This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.Use tune2fs -c or -i to override.














● 本文在itpub(http://blog.itpub.net/26736162)和个人微信公众号(xiaomaimiaolhr)上有同步更新




● QQ群:230161599微信群:私聊


● 于 2017-07-01 09:00 ~ 2017-07-31 22:00 在魔都完成


● 版权所有,欢迎分享本文,转载请保留出处






拿起手机使用微信客户端扫描下边的左边图片来关注小麦苗的微信公众号:xiaomaimiaolhr,扫描右边的二维码加入小麦苗的QQ群,学习最实用的数据库技术。
Linux虚拟磁盘挂载错误,不能进入系统(fsck.ext3:no such file directory)

文章图片


    推荐阅读