Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use NTFS to distinguish disks in Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to use NTFS to distinguish disks in Linux. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Solution

Buy a separate 8T hard drive and mount it on my personal computer. At this time, pay attention to the partition selection of EXT4, and the problem will be solved perfectly.

Or, the original Windows under the D disk (Windows unique NTFS differentiated disk), divided into a 3T, and then set it this partition of the file system to EXT4 is also possible.

As you can see, the following two hard drives are completely different partitioning schemes.

Since our 500Gb solid state drive can be divided into so many different zones, theoretically our 8T mechanical hard drive should be the same.

Partition 8T mechanical hard disk

The parted command is a powerful disk partition and partition resizing tool developed by the GNU organization. Unlike fdisk, it supports resizing partitions.

As a tool designed for Linux, it is not built to handle multiple partition types associated with fdisk, but it can handle the most common partition formats, including: ext2, ext3, fat16, fat32, NTFS, ReiserFS, JFS, XFS, UFS, HFS, and Linux swap partitions.

Earlier, we saw that one of the partitions directly occupied the 8T hard drive:

(parted) print

Model: ATA ST8000NM000A-2KE (scsi)

Disk / dev/sda: 8002GB

Sector size (logical/physical): 512B/4096B

Partition Table: gpt

Disk Flags:

Number Start End Size File system Name Flags

1 17.4kB 16.8MB 16.8MB Microsoft reserved partition msftres

2 16.8MB 8002GB 8002GB ntfs Basic data partition msftdata

(parted) mkpart xfs 50%

Warning: You requested a partition from 4001GB to 8002GB (sectors 7814026583.. 15628053167).

The closest location we can manage is 8002GB to 8002GB (sectors 15628050432.. 15628053134).

In that case, we won't be able to use 8T disks at all.

Reducing partition size is a very dangerous operation

The (p) after the partition name represents the basic partition, (e) represents the extended partition, and (l) represents the logical partition.

Because I have 2T data in my 8T hard drive, if I force a division, I hope 4T will take it out and do the following dangerous operations:

(parted) resize 2

Error: The resize command has been removed in parted 3.0

(parted) resizepart 2

Warning: Partition / dev/sda2 is being used. Are you sure you want to continue?

Yes/No? Yes

End? [8002GB]? 4000

Warning: Shrinking a partition can cause data loss, are you sure you want to continue?

Yes/No? Yes

Alert: data loss! Oh, it's really sad. I thought it was.

Then the spare 4T hard disk location can create a new partition!

Mkpart xfs 4000MB 100%

Quit

About the file system:

Ext2/3/4: is a file system type suitable for Linux. Because the ext3 file system has more logging features, the system recovers faster. Ext4 is an upgrade of ext3, which is more efficient, so it is recommended to use the default type ext4 instead of ext2/3;xfs: it is also a file system type, which will be used as the default file system type in centos7 to replace ext4.

Later, I found that I also wrote the partition wrong. 4000G should have been written as 4000MB.

Check the partition sudo fsck-t ext4 / dev/sda4

Fsck from util-linux 2.34

E2fsck 1.45.5 (07-Jan-2020)

Ext2fs_open2: Bad magic number in super-block

Fsck.ext4: Superblock invalid, trying backup blocks...

Fsck.ext4: Bad magic number in super-block while trying to open / dev/sda4

The superblock could not be read or does not describe a valid ext2/ext3/ext4

Filesystem. If the device is valid and it really contains an ext2/ext3/ext4

Filesystem (and not swap or ufs or something else), then the superblock

Is corrupt, and you might try running e2fsck with an alternate superblock:

E2fsck-b 8193

Or

E2fsck-b 32768

This is how to use NTFS to distinguish disks in Linux shared by Xiaobian. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report