|
问题是这样出现:
最初安装Fedora 13时,硬盘(IDE)只是分了2个区:sda1,大约4G,挂载到"/".sda2,大约1G,作为交换分区.现在想换一个硬盘(也是IDE的),而不想重新再装一遍.所以先将新硬盘挂到主机上,作为第2个硬盘(sdb).用fdisk对它行分区:sdb1,大约7G,格式化为ext4格式(mkfs.ext4命令).sdb2,大约1G,格式化为交换分区(mkswap命令).
然后执行dd if=/dev/sda1 of=/dev/sdb1
运行完毕后,执行grub指令:
[root@test-bak ~]# grub
Probing devices to guess BIOS drives. This may take a long time.
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> root (hd1,0)
root (hd1,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1)"... 26 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+26 p (hd1,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.
grub>
将grub安装到新硬盘的mbr区.
关闭电脑,将旧的硬盘拆下来,只留新的硬盘并在主板上设成从它启动.开机后能正常启动并进入系统并登录,但是这个时候执行df与fdisk -l输出的结果就不一样了:
[root@test-bak ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 4128448 604028 3314708 16% /
tmpfs 254888 0 254888 0% /dev/shm
[root@test-bak ~]# fdisk -l
Disk /dev/sda: 20.5 GB, 20547841536 bytes
255 heads, 63 sectors/track, 2498 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 1045 8393931 83 Linux
/dev/sda2 1046 1212 1341427+ 82 Linux swap / Solaris
fdisk -l说新硬盘的第一分区有7G的容量,而df却显示第一分区还是与旧的硬盘一样只到4G的容量.
请问一下为何会出现这样的情况?我能使用的空间到底是多少?不一致是否会对系统有不利的影响? |
|