- 浏览: 52268 次
- 性别:
- 来自: 沈阳
文章分类
最新评论
-
z_xiaodong7134:
你好!我的实例经常莫名其妙的ssh不上去,实例是running ...
Eucalyptus安装与配置 -
dotjar:
同款
购买三星S5830历程 -
kidding87:
用户组没有给它分配权限吧修改系统的环境变量试试看呢
oracle : shared memory realm does not exist 故障解决 -
zhangpuego:
他们每人交了9元,是27元.退了他们每人1元.所以总共的钱数应 ...
多个服务器,去掉一个服务器后的分配 -
zhangpuego:
这里我简单点说,用几个计算式子吧。
1.店主的折扣价(25)+ ...
多个服务器,去掉一个服务器后的分配
1 缩小一个ext3分区
这个章节介绍如何缩小一个ext3分区。在这个例子中,我将缩小我的/dev/sda5。首先让我们来看看目前系统的一些情况:
fdisk -l
df
如果你的分区中没有任何系统文件,则继续下面的步骤,否则,请重新启动系统.
当然,我们还是手工umount一次:
umount /dev/sda5
接下来运行:
fsck -n /dev/sda1
输出应该是这样的:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159037/1254176 files, 1095299/2504124 blocks
现在,我们将日志从/dev/sda1中去除,等于将其转成ext2系统:
tune2fs -O ^has_journal /dev/sda5
输出是这样的:
tune2fs 1.38 (30-Jun-2005)
接下来运行:
e2fsck -f /dev/sda5
运行结果:
e2fsck 1.38 (30-Jun-2005)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 164178/1254176 files (0.6% non-contiguous), 1051617/2504124 blocks
现在,我们用resize2fs来改变文件系统的大小。这个程序只能改变ext2文件系统的大小,这就是为什么刚才我们要先将ext3转换成ex2的原因。当前/dev/sda1已用4.1GB(刚才的df输出可以看到),因此,将10GB的分区缩小到6GB是比较安全的(不能转换到4.1GB以下,否则会丢失数据)。我们运行:
resize2fs /dev/sda5 6000M
输出:
resize2fs 1.38 (30-Jun-2005)
Resizing the filesystem on /dev/sda1 to 1536000 (4k) blocks.
The filesystem on /dev/sda1 is now 1536000 blocks long.
请注意这些信息:块的数量(1536000)和大小(4k),一会我们将用到。接下来,我们将删除/dev/sda1分区,并创建一个新的,更小的分区。别害怕,不会有数据损失的。我们在fdisk下进行:
fdisk /dev/sda
注意阿,是sda,不是sda1。之后会显示:
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)
现在,我们来删除/dev/sda5:
Command (m for help): d
Partition number (1-5): 5
然后创建一个新的/dev/sda5。由于之前它是一个主分区,所以这里我们选择p,并且是一号分区:
Command (m for help): n
Partition number (1-4): 5
现在,就到了关键步骤了:我们被要求输入新分区的大小。首柱面号不是问题,这可以从文章开始时fdisk -l的输出中获得,但我们还不清楚新分区的末柱面号是多少。幸运的是,我们能够确定以k位单位的分区大小,然后按照这个公式计算:
1536000 * 4k * 1.03 = 6328320k
然后,我们在结果前面加上一个+号,并将小写的k换成大写的K,再输入:
Last cylinder or +size or +sizeM or +sizeK (1-1247, default 1247): +6328320K
现在,写入新的分区表并退出:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
然后重新启动。注意,这次还是启动到live-CD环境中(或者rescue模式),用su命令再次切换成root用户,然后运行:
fsck -n /dev/sda5
输出应该是这样的:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159036/765536 files, 1047239/1536000 blocks
接下来,在新的/dev/sda1上创建日志文件,转换回ext3文件系统:
tune2fs -j /dev/sda1
tune2fs 1.38 (30-Jun-2005)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
好了,这下完成了。再次重启,启动到你原来的系统中,看看:
fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 789 6337611 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
fdisk -s /dev/sda1
6337611 搞定!
2 扩大一个ext3分区
在这里,我们拥有一个大约是6GB的/dev/sda1分区,在它后面,有一个大约4GB的未用空间(刚刚分出来的,呵呵)。现在,我们要做的就是把这 4GB的空闲空间增加到/dev/sda1分区中。请注意,如果这4GB的空余空间不在/dev/sda1后面,而是在硬盘的其它地方,就无法实现这个目的!
首先,我们收集一些当前分区的资料。
fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 789 6337611 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
fdisk -s /dev/sda1
6337611
然后,我们需要关闭系统,并启动系统:
卸载sda5:
umount /dev/sda5
然后执行:
fsck -n /dev/sda1
输出:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159036/765536 files, 1080014/1536000 blocks
然后是:
tune2fs -O ^has_journal /dev/sda5
输出:
tune2fs 1.38 (30-Jun-2005)
接下来运行:
fdisk /dev/sda
输出:
(Yes, it's /dev/sda, not /dev/sda1.)
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)
Type m to get a list of all commands:
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
我们来打印分区表:
Command (m for help): p
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 789 6337611 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
现在,删除第一个分区:
Command (m for help): d
Partition number (1-5): 1
然后创建一个新的sda1分区,大体事项和缩小分区步骤一样:
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
p
Partition number (1-4): 1
现在就该确定最开始和末尾的柱面号,首先输出起始柱面号:
First cylinder (1-1305, default 1):
然后fdisk会告述我们可能的最大柱面号,在这里是1247,然后我们直接输入就行了:
Last cylinder or +size or +sizeM or +sizeK (1-1247, default 1247): 1247
然后看一下新的分区表:
Command (m for help): p
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 1247 10016496 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
别忘了,之前的分区是启动分区,所以还需要做:
Command (m for help): a
Partition number (1-5): 1
最后写入:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
然后重新启动。还是启动到live-CD环境中(或者rescue模式),用su命令再次切换成root用户,然后运行:
fsck -n /dev/sda1
输出应该是这样的:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159036/765536 files, 1047239/1536000 blocks
接下来,在新的/dev/sda1上创建日志文件,转换回ext3文件系统:
tune2fs -j /dev/sda5
tune2fs 1.38 (30-Jun-2005)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
好了,这下完成了。再次重启,启动到你原来的系统中,看看:
fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1247 10016496 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
fdisk -s /dev/sda1
10016496
3 合并两个ext3分区:
在这个实例中,我的系统分区还是6GB左右的/dev/sda1,其后紧跟着/dev/sda3分区(大概4GB)。/dev/sda3挂载于/data目录,没有系统所需要的文件,只有用户数据。用df -h看,当前的分区就像这样:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 5.8G 4.1G 1.6G 73% /
varrun 94M 132K 94M 1% /var/run
varlock 94M 0 94M 0% /var/lock
udev 10M 56K 10M 1% /dev
devshm 94M 0 94M 0% /dev/shm
lrm 94M 18M 77M 19% /lib/modules/2.6.17-10-generic/volatile
/dev/sda3 3.5G 72M 3.3G 3% /data
为了合并两个分区,我们必须删除/dev/sda3分区,然后增大sda1分区,就像第三部分描述的那样。也就是说,所有/sda3上的数据全部都会消失。因此,如果你还需要它们的话,请首先备份数据,之后再拷贝到新的,并且更大的sda1上面。
现在,我们打开/etc/fstab,移除与/dev/sda3有关的行(如果存在的话)。新的,不包含/sda3分区信息的fstab应该是像这样的:
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
# /dev/sda1
UUID=566fd9e9-098f-4aae-9908-51efe171d8ba / ext3 defaults,errors=remount-ro 0 1
# /dev/sda5
UUID=82102b65-35db-469a-9532-03d619d8cffb none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0
然后,让我们umount /dev/sda3,用fdisk来删除它。首先umount /dev/sda3,然后fdisk /dev/sda(注意,这里是sda,不是sda3):
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)
Type m to get a list of all commands:
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
现在,删除sda3:
Command (m for help): d
Partition number (1-5): 3
接下来,向硬盘写入新的分区表:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
最后,重新启动系统,进入Live-CD环境或者rescue系统,从这里开始,步骤和第三部分就完全一样的,从su到umount /dev/sda1,其后的步骤请自行参考第三部分。
网址:http://www.linuxdiyf.com/viewarticle.php?id=58915
这个章节介绍如何缩小一个ext3分区。在这个例子中,我将缩小我的/dev/sda5。首先让我们来看看目前系统的一些情况:
fdisk -l
df
如果你的分区中没有任何系统文件,则继续下面的步骤,否则,请重新启动系统.
当然,我们还是手工umount一次:
umount /dev/sda5
接下来运行:
fsck -n /dev/sda1
输出应该是这样的:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159037/1254176 files, 1095299/2504124 blocks
现在,我们将日志从/dev/sda1中去除,等于将其转成ext2系统:
tune2fs -O ^has_journal /dev/sda5
输出是这样的:
tune2fs 1.38 (30-Jun-2005)
接下来运行:
e2fsck -f /dev/sda5
运行结果:
e2fsck 1.38 (30-Jun-2005)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 164178/1254176 files (0.6% non-contiguous), 1051617/2504124 blocks
现在,我们用resize2fs来改变文件系统的大小。这个程序只能改变ext2文件系统的大小,这就是为什么刚才我们要先将ext3转换成ex2的原因。当前/dev/sda1已用4.1GB(刚才的df输出可以看到),因此,将10GB的分区缩小到6GB是比较安全的(不能转换到4.1GB以下,否则会丢失数据)。我们运行:
resize2fs /dev/sda5 6000M
输出:
resize2fs 1.38 (30-Jun-2005)
Resizing the filesystem on /dev/sda1 to 1536000 (4k) blocks.
The filesystem on /dev/sda1 is now 1536000 blocks long.
请注意这些信息:块的数量(1536000)和大小(4k),一会我们将用到。接下来,我们将删除/dev/sda1分区,并创建一个新的,更小的分区。别害怕,不会有数据损失的。我们在fdisk下进行:
fdisk /dev/sda
注意阿,是sda,不是sda1。之后会显示:
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)
现在,我们来删除/dev/sda5:
Command (m for help): d
Partition number (1-5): 5
然后创建一个新的/dev/sda5。由于之前它是一个主分区,所以这里我们选择p,并且是一号分区:
Command (m for help): n
Partition number (1-4): 5
现在,就到了关键步骤了:我们被要求输入新分区的大小。首柱面号不是问题,这可以从文章开始时fdisk -l的输出中获得,但我们还不清楚新分区的末柱面号是多少。幸运的是,我们能够确定以k位单位的分区大小,然后按照这个公式计算:
1536000 * 4k * 1.03 = 6328320k
然后,我们在结果前面加上一个+号,并将小写的k换成大写的K,再输入:
Last cylinder or +size or +sizeM or +sizeK (1-1247, default 1247): +6328320K
现在,写入新的分区表并退出:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
然后重新启动。注意,这次还是启动到live-CD环境中(或者rescue模式),用su命令再次切换成root用户,然后运行:
fsck -n /dev/sda5
输出应该是这样的:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159036/765536 files, 1047239/1536000 blocks
接下来,在新的/dev/sda1上创建日志文件,转换回ext3文件系统:
tune2fs -j /dev/sda1
tune2fs 1.38 (30-Jun-2005)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
好了,这下完成了。再次重启,启动到你原来的系统中,看看:
fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 789 6337611 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
fdisk -s /dev/sda1
6337611 搞定!
2 扩大一个ext3分区
在这里,我们拥有一个大约是6GB的/dev/sda1分区,在它后面,有一个大约4GB的未用空间(刚刚分出来的,呵呵)。现在,我们要做的就是把这 4GB的空闲空间增加到/dev/sda1分区中。请注意,如果这4GB的空余空间不在/dev/sda1后面,而是在硬盘的其它地方,就无法实现这个目的!
首先,我们收集一些当前分区的资料。
fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 789 6337611 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
fdisk -s /dev/sda1
6337611
然后,我们需要关闭系统,并启动系统:
卸载sda5:
umount /dev/sda5
然后执行:
fsck -n /dev/sda1
输出:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159036/765536 files, 1080014/1536000 blocks
然后是:
tune2fs -O ^has_journal /dev/sda5
输出:
tune2fs 1.38 (30-Jun-2005)
接下来运行:
fdisk /dev/sda
输出:
(Yes, it's /dev/sda, not /dev/sda1.)
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)
Type m to get a list of all commands:
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
我们来打印分区表:
Command (m for help): p
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 789 6337611 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
现在,删除第一个分区:
Command (m for help): d
Partition number (1-5): 1
然后创建一个新的sda1分区,大体事项和缩小分区步骤一样:
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
p
Partition number (1-4): 1
现在就该确定最开始和末尾的柱面号,首先输出起始柱面号:
First cylinder (1-1305, default 1):
然后fdisk会告述我们可能的最大柱面号,在这里是1247,然后我们直接输入就行了:
Last cylinder or +size or +sizeM or +sizeK (1-1247, default 1247): 1247
然后看一下新的分区表:
Command (m for help): p
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 1247 10016496 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
别忘了,之前的分区是启动分区,所以还需要做:
Command (m for help): a
Partition number (1-5): 1
最后写入:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
然后重新启动。还是启动到live-CD环境中(或者rescue模式),用su命令再次切换成root用户,然后运行:
fsck -n /dev/sda1
输出应该是这样的:
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/sda1: clean, 159036/765536 files, 1047239/1536000 blocks
接下来,在新的/dev/sda1上创建日志文件,转换回ext3文件系统:
tune2fs -j /dev/sda5
tune2fs 1.38 (30-Jun-2005)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
好了,这下完成了。再次重启,启动到你原来的系统中,看看:
fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1247 10016496 83 Linux
/dev/sda2 1248 1305 465885 5 Extended
/dev/sda5 1248 1305 465853+ 82 Linux swap / Solaris
fdisk -s /dev/sda1
10016496
3 合并两个ext3分区:
在这个实例中,我的系统分区还是6GB左右的/dev/sda1,其后紧跟着/dev/sda3分区(大概4GB)。/dev/sda3挂载于/data目录,没有系统所需要的文件,只有用户数据。用df -h看,当前的分区就像这样:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 5.8G 4.1G 1.6G 73% /
varrun 94M 132K 94M 1% /var/run
varlock 94M 0 94M 0% /var/lock
udev 10M 56K 10M 1% /dev
devshm 94M 0 94M 0% /dev/shm
lrm 94M 18M 77M 19% /lib/modules/2.6.17-10-generic/volatile
/dev/sda3 3.5G 72M 3.3G 3% /data
为了合并两个分区,我们必须删除/dev/sda3分区,然后增大sda1分区,就像第三部分描述的那样。也就是说,所有/sda3上的数据全部都会消失。因此,如果你还需要它们的话,请首先备份数据,之后再拷贝到新的,并且更大的sda1上面。
现在,我们打开/etc/fstab,移除与/dev/sda3有关的行(如果存在的话)。新的,不包含/sda3分区信息的fstab应该是像这样的:
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
# /dev/sda1
UUID=566fd9e9-098f-4aae-9908-51efe171d8ba / ext3 defaults,errors=remount-ro 0 1
# /dev/sda5
UUID=82102b65-35db-469a-9532-03d619d8cffb none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0
然后,让我们umount /dev/sda3,用fdisk来删除它。首先umount /dev/sda3,然后fdisk /dev/sda(注意,这里是sda,不是sda3):
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)
Type m to get a list of all commands:
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
现在,删除sda3:
Command (m for help): d
Partition number (1-5): 3
接下来,向硬盘写入新的分区表:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
最后,重新启动系统,进入Live-CD环境或者rescue系统,从这里开始,步骤和第三部分就完全一样的,从su到umount /dev/sda1,其后的步骤请自行参考第三部分。
网址:http://www.linuxdiyf.com/viewarticle.php?id=58915
发表评论
-
free -m
2012-07-03 14:30 832第一部分 ... -
自己写的小程序顺着linux启动而启动
2012-04-16 19:42 981自己写的小程序想根据linux启动而自动启动。 需要以下步骤 ... -
在CentOS 5.5里安装使用Chrome/Chromium浏览器
2011-12-14 20:06 1630通过Chrome wrapper在RHEL/CentOS 5上 ... -
eclipse启动时出现JVM terminated.Exit code=127解决方案
2011-12-13 19:32 2060异常退出显示的内容: JVM terminated. E ... -
centos 同步时间
2011-12-12 09:18 806CentOS系统时间同步的步骤如下: 新装的Cent ... -
CentOS上jdk的安装
2011-11-30 22:19 850CentOS上jdk的安装: 1.选择一个用户,比如 zha ... -
使用u盘安装CentOS,出现必须U盘引导的问题
2011-11-11 18:59 2019无光驱情况下,U盘启动安装CentOS (笔记) ... -
Centos5.7上安装oracle10g
2011-11-13 10:32 7731.添加oracle的用户 (1) 新增组和用户group ... -
Linux分区与目录的挂载
2011-11-10 10:39 657实际使用Ext3文件系统 创建新的ext3文件系统,例如 ... -
CentOS上安装字体和scim
2011-11-13 10:32 1947CentOS上安装字体:输入 1 ... -
在centos上安装软件时出现Could not execute auto check for display colors using command
2011-11-12 18:52 3102Two solutions: 1.use oracl ... -
CentOS yum使用
2011-11-12 18:52 6931 )包的更新 1.1)检查可更新包: yum ch ... -
使用xmamager来连接centos
2011-11-10 10:40 8031)编辑/etc/gdm/custom.conf,内容如下 ... -
IPTABLES的配置
2011-11-19 18:27 616(1)查看本机关于IPTABLE ...
相关推荐
Windows 7下使用Ext2Fsd读取写入Linux Ext3&Ext4分区文件
XP下读写Linux Ext3分区的软件
从ext3 ext4分区读取文件的工具,支持磁盘映像。
ext2/3,扩展文件系统,常用于Linux操作系统。是很多Linux发行版的默认文件系统。 Linux ext2/ext3文件系统使用索引节点来记录文件信息,作用像windows的文件分配表。 索引节点(inode)是一个结构,它包含了一个...
本文向各位介绍Linux下使用ext3日志文件系统应用。Ext3文件系统是直接从Ext2文件系统发展而来,目前ext3文件系统已经非常稳定可靠。...ext3文件系统能够极大地提高文件系统的完整性,避免了意外宕机对文件系统的破坏。
R-Linux是一个专业用来恢复linux下Ext2或者Ext3格式硬盘文件的工具,需要在Windows下运行。文件回复的时候不能够安装原来的文件目录恢复,而是按照文件的类型(扩展名)进行分类恢复,而且文件名是数字编号。
强烈推荐!!! windows10下轻松读取linux各种ext2、ext3格式等文件。 什么Ext2Fsd 0.7都是骗大家下载积分的。
Windows下读写Linux下Ext2分区的工具。大多数这样的工具,一般只有读的功能,不能写Ext2分区,但是这个软件可以写。 此软件支持drag and drop,但是您需要做出以下设定,在主菜单中选择“View”→“Options”→...
测试多种软件,有Gparted、R-studio、DiskGenius等等软件,看看哪款软件可以把删除的ext4分区给找回来,最后结论是备份分区表才是王道啊。
在windows下查看linux分区的软件,指定盘符,查看分区内容等
ext4分区,完全格式化,适用于安卓系统ext4分区的手机
在windows下能够直接读写ext2和ext3分区格式的U盘,移动硬盘
linux 修复ext3文件系统 修复顺坏ext3文件系统 linux常用工具
Ext2Fsd是在windows下读写ext2 和ext3格式的小工具,当经过linux系统格式化为ext3格式的U盘插入到windows系统下时,windows系统会提示不识别磁盘格式,建议格式化磁盘。安装了Ext2Fsd工具后,你就可以像读写FAT格式...
能在windows下读取linux分区,ext2ifs
Linux实现从Ext2到Ext3文件系统的转换.pdf
linuxext3支持2T以上大硬盘分区.pdf
PDF文件,对linux的ext2,ext3文件系统进行了详细的解释.图文并荗.
Ext2Read 它能查看 ext2/3/4 分区并从中拷贝文件和目录,支持 LVM2 和 EXT4 extent ,以及递归拷贝整个目录。
手工定位Ext3分区下的文件,并提取出相应的文件,本资料为视频文件