系统故障,刚好有个阿里云的磁盘。
1.格式化分区,挂载
2.将重要文件备份到数据盘。
3. 卸载数据盘
4. 重做系统盘
5. 再挂载数据盘。 备份文件依然存在。
格式化分区+挂载 :
[root@testserver ~]# fdisk -l
Disk /dev/xvda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009e68a
Device Boot Start End Blocks Id System
/dev/xvda1 * 2048 83884031 41940992 83 Linux
Disk /dev/xvdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa3bf84e1
Device Boot Start End Blocks Id System
/dev/xvdb1 2048 1048575999 524286976 83 Linux
[root@testserver ~]# mkfs
mkfs mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.fat mkfs.minix mkfs.msdos mkfs.vfat mkfs.xfs
[root@testserver ~]# mkfs
mkfs mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.fat mkfs.minix mkfs.msdos mkfs.vfat mkfs.xfs
[root@testserver ~]# mkfs /dev/xvdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768000 inodes, 131071744 blocks
6553587 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4000 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
[root@testserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 40G 17G 21G 45% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.7G 0 3.7G 0% /dev/shm
tmpfs 3.7G 8.4M 3.7G 1% /run
tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup
[root@testserver ~]# mount /dev/xvdb1 /tmp/xdb1/
[root@testserver ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 40G 17G 21G 45% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.7G 0 3.7G 0% /dev/shm
tmpfs 3.7G 8.4M 3.7G 1% /run
tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup
/dev/xvdb1 493G 70M 468G 1% /tmp/xdb1
[root@testserver ~]#
卸载:
umount /dev/xvdb1