网站之家技术交流论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1981|回复: 0

将ntfs分区转换为ext4分区

[复制链接]
发表于 2017-5-27 23:02:22 | 显示全部楼层 |阅读模式
[root@fedora15 zou]# fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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 identifier: 0xb532b532

Device Boot Start End Blocks Id System
/dev/sda1 * 63 62926604 31463271 7 HPFS/NTFS/exFAT
/dev/sda2 62926605 488392064 212732730 f W95 Ext'd (LBA)
/dev/sda5 62926668 176184854 56629093+ 7 HPFS/NTFS/exFAT
/dev/sda6 176184918 289443104 56629093+ 7 HPFS/NTFS/exFAT
/dev/sda7 289443168 402701354 56629093+ 7 HPFS/NTFS/exFAT
/dev/sda8 402704384 403728383 512000 83 Linux
/dev/sda9 403730432 488390655 42330112 8e Linux LVM

现在,要把/dev/sda7 ,即F盘的NTFS格式转换成ext4格式,归linux使用。方法:
umount /dev/sda7

用fdisk转换分区格式,改为8e
fdisk /dev/sda
Command (m for help): m (这里有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 //这个t就是偶们要用的
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

下面就是要用t命来修改下分区的id
Command (m for help): t
Partition number (1-10): 7 //这个是分区号
Hex code (type L to list codes):8e // 8e是Linux LVM 的id,可以敲一个“L”查看一下,这样分区的格式就转换完啦。
Command (m for help): w
可以看到/dev/sda7分区

格式化分区:
mkfs.ext4 /dev/sda7

创建/jackzou19目录:
mkdir /data1

挂载分区:
mount /dev/sda7/home/jackzou19
然后挂载好,现在的情况如下:

[root@fedora15 zou]# df -h

文件系统 容量 已用 可用 已用%% 挂载点
rootfs 36G 9.6G 25G 29% /
udev 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 2.9M 1.9G 1% /dev/shm
tmpfs 1.9G 732K 1.9G 1% /run
/dev/mapper/vg_fedora15-lv_root
36G 9.6G 25G 29% /
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 1.9G 0 1.9G 0% /media
/dev/sda8 485M 70M 390M 16% /boot
/dev/mapper/vg_fedora15-lv_root
36G 9.6G 25G 29% /tmp
/dev/mapper/vg_fedora15-lv_root
36G 9.6G 25G 29% /var/tmp
/dev/mapper/vg_fedora15-lv_root
36G 9.6G 25G 29% /home
/dev/sda7 54G 180M 51G 1% /home/jackzou19
/dev/sda6 55G 12G 43G 22% /media/Life
/dev/sda5 55G 38G 17G 70% /media/My
/dev/sda1 31G 27G 3.6G 89% /media/Fuck

fuck my life 分别对应这windows系统下的C、D、E盘。

最后设置系统自动加载

[root@fedora15 zou]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Aug 10 09:42:30 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_fedora15-lv_root / ext4 defaults 1 1
UUID=9cdeb21c-7032-431d-acd5-06b49037f86e /boot ext4 defaults 1 2
/dev/mapper/vg_fedora15-lv_swap swap swap defaults 0 0
/dev/sda7 /home/jackzou19 ext4 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|网站之家技术交流论坛 ( 粤ICP备09092995号 )

GMT+8, 2024-12-22 00:35 , Processed in 0.087157 second(s), 7 queries , File On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表