一.先查看对应分区:
sudo fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0x0004bbac
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 217683967 108840960 83 Linux
/dev/sda2 217686014 234440703 8377345 5 Extended
/dev/sda5 217686016 234440703 8377344 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x7d826b35
Device Boot Start End Blocks Id System
/dev/sdb1 2048 419434495 209716224 7 HPFS/NTFS/exFAT
/dev/sdb2 419434496 976773119 278669312 f W95 Ext'd (LBA)
/dev/sdb5 419436544 976773119 278668288 7 HPFS/NTFS/exFAT
二.接着,要把/dev/sdb1 的NTFS格式转换成ext4格式。方法:
sudo umount /dev/sdb1
用fdisk转换分区格式,改为8e
sudo fdisk /dev/sdb
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): 1 //这个是分区号
Hex code (type L to list codes):8e // 8e是Linux LVM 的id,可以敲一个“L”查看一下,这样分区的格式就转换完啦。
Command (m for help): w
可以看到/dev/sdb1分区
三.格式化分区:
sudo mkfs.ext4 /dev/sdb1
四.挂载分区
4.1.先在/home/worker目录创建NewDisk文件夹
mkdir /home/worker/NewDisk
4.2.挂载:
mount /dev/sdb1 /home/worker/NewDisk
4.3.查看挂载结果:
worker@worker:~/NewDiskTwo/projects/6UL$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 4.0K 3.9G 1% /dev
tmpfs 798M 1.6M 796M 1% /run
/dev/sda1 103G 87G 11G 89% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 69M 3.9G 2% /run/shm
none 100M 88K 100M 1% /run/user
/dev/sdb5 266G 123G 143G 47% /home/worker/NewDiskTwo
/dev/sdb1 197G 62G 126G 33% /home/worker/NewDisk
五.设置系统自动加载
sudo gedit /etc/fstab 在里面加上如下加厚的语句,然后保存退出。
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=ec8f625c-3c04-47f0-8335-e5c619e2cd1e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=48c24e76-b0ac-48da-8af1-b6327c698e16 none swap sw 0 0
UUID=74CCD1D0B7486AE4 /home/worker/NewDiskTwo ntfs defaults 0 2
/dev/sdb1 /home/worker/NewDisk ext4 defaults 0 2
本文介绍了如何在Ubuntu系统中将NTFS格式的分区转换为EXT4格式,包括查看分区信息、使用fdisk转换分区类型、mkfs.ext4格式化分区、挂载新分区以及设置系统自动加载新分区的方法。通过这些步骤,可以成功将/dev/sdb1从NTFS转换为EXT4并挂载到/home/worker/NewDisk。

399

被折叠的 条评论
为什么被折叠?



