简体   繁体   English

如何将 64GB USB 的文件系统从 FAT32 更改为任何允许我将 x86_64 Linux 机器上的 35GB 文件放到 USB 上的文件系统?

[英]How do I change the filesystem of my 64GB USB, from FAT32 to anything which allows me to put a 35GB file from my x86_64 Linux machine onto the USB?

'uname -a' on my machine gives:我机器上的“uname -a”给出:

Linux ct-lt-966 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux

Currently the filesystem of my USB is MS-DOS 'FAT32' which has a ~4.5 GB maximum size for individual files.目前我的 USB 文件系统是 MS-DOS 'FAT32',单个文件的最大大小约为 4.5 GB。 I want to change this filesystem to something else, which does not have a limit.我想将此文件系统更改为其他没有限制的文件系统。 (I am trying to put a 35GB file onto a 64GB USB but I believe most USB filesystems do not limit the size of individual files). (我试图将 35GB 的文件放到 64GB 的 USB 上,但我相信大多数 USB 文件系统不限制单个文件的大小)。

I have not found it clear what choices of USB filesystem that I have.我还没有发现我有哪些 USB 文件系统可供选择。 I tried to change the filesystem to 'NTFS', but I could not install or locate 'mkfs.ntfs' or even 'ntfsprogs'.我尝试将文件系统更改为“NTFS”,但无法安装或定位“mkfs.ntfs”甚至“ntfsprogs”。 (I also tried installing with 'pacman' and 'yum' but apparently 'pacman' requires an aarch architecture and I could not get access to 'yum-config-manager' in order to enable any repos). (我也尝试使用 'pacman' 和 'yum' 进行安装,但显然 'pacman' 需要 aarch 架构,我无法访问 'yum-config-manager' 以启用任何存储库)。

So to conclude, with my minimal prowess I am just looking for any way to change the filesystem of my 64GB USB to anything which will accept a 35GB file from my machine.总而言之,以我最小的能力,我只是在寻找任何方法来将我的 64GB USB 的文件系统更改为任何可以接受来自我的机器的 35GB 文件的文件系统。

Thanks谢谢

Edit 1: Just planning to use the USB on this Linux machine, not Windows.编辑 1:只是打算在这台 Linux 机器上使用 USB,而不是 Windows。

If there's nothing on the stick you want, or it's safe to delete it then basically:如果棒上没有你想要的任何东西,或者删除它是安全的,那么基本上:

  • delete the current FAT32 partition from the stick从棒中删除当前的 FAT32 分区
  • add a new partition, utilising the full size of the device添加一个新分区,利用设备的完整大小
  • create an ext4 filesystem on the new partition在新分区上创建一个 ext4 文件系统

PLEASE BE CAREFUL WITH THIS PROCESS: selecting the wrong device can obliterate a disk you needed such as a $HOME or your root OS请注意此过程:选择错误的设备可能会删除您需要的磁盘,例如$HOME或您的根操作系统

All the following is from memory and untested: I don't have a USB stick available right now to test fully.以下所有内容均来自内存且未经测试:我现在没有可用的 USB 记忆棒来进行全面测试。

Start by plugging in the stick while tailing the syslog in a console and see where it gets mounted (hopefully it automounts which it should if it's a desktop based Linux you're running. Possibly not if it's a server)..首先插入棒,同时在控制台中拖尾系统日志,然后查看它的安装位置(希望它自动安装,如果它是您正在运行的基于桌面的 Linux,则它应该自动安装。如果它是服务器,则可能不会)。

sudo tail -f /var/log/syslog

(it might be /var/log/messages depending on distro) (它可能是/var/log/messages取决于发行版)

then plug the stick.然后插上棒子。 syslog should show it being allocated a device and a mount point. syslog 应该显示它被分配了一个设备和一个挂载点。 A file manager window may open depending on your config if you are in a GUI.如果您在 GUI 中,可能会根据您的配置打开文件管理器窗口。 For example, you might see it being loaded on /dev/sdc1 and mounted at /media/<yourusername>/USBKEY or something.例如,您可能会看到它被加载到/dev/sdc1并挂载在/media/<yourusername>/USBKEY或其他地方。

Confirm by running lsblk and note the device for the key, ie通过运行lsblk确认并记下密钥的设备,即

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 167.7G  0 disk 
├─sda1   8:1    0  69.9G  0 part /
└─sda2   8:2    0  97.9G  0 part /home
sdb      8:16   0 149.1G  0 disk 
└─sdb1   8:17   0 149.1G  0 part /mnt/snapshots
sdc      8:32   0 931.5G  0 disk 
└─sdc1   8:33   0 931.5G  0 part /storage
sdd      8:48   0 465.8G  0 disk 
└─sdd1   8:49   0 465.8G  0 part /mnt/backup
sr0     11:0    1  1024M  0 rom  

Unmount the stick (if it mounted) but leave it plugged in. Assuming again your device is at /dev/sdc1 ...卸载棒(如果已安装)但保持插入状态。再次假设您的设备位于/dev/sdc1 ...

umount /dev/sdc1

Now run cfdisk in a terminal if you have it (friendlier) or fdisk if not, passing it the device related to your USB stick, without the partition number.现在在终端中运行cfdisk如果你有它(更友好)或fdisk如果没有,将与你的 USB 记忆棒相关的设备传递给它,没有分区号。

man cfdisk
sudo cfdisk /dev/sdc

This should show the current FAT32 partition.这应该显示当前的 FAT32 分区。 Delete it, then create a new partition of type 'Linux', following the defaults for start and end blocks which will be suggested in such a way as to fill the available space.删除它,然后创建一个“Linux”类型的新分区,遵循开始和结束块的默认值,以填充可用空间的方式建议。

When done, select the option to Write the changes.完成后,选择Write更改的选项。 Again, DOUBLE AND TRIPLE CHECK you have the right device or you will blow away your main disk probably.再次,双重和三重检查您是否拥有正确的设备,否则您可能会吹走您的主磁盘。

Once the changes are written, you can create the ext4 file system;写入更改后,您可以创建ext4文件系统;

sudo mkfs.ext4 /dev/sdc1

And after it completes, you should be able to re-plug your stick and find that it remounts, this time with a file system that can take your large files.完成后,您应该能够重新插入您的记忆棒并发现它重新挂载,这次使用的是可以容纳您的大文件的文件系统。

This isn't the only way to achieve this, but it's probably the least fiddly.这不是实现这一目标的唯一方法,但它可能是最简单的方法。 For the sake of repetition, don't make a mistake with the device identifiers.为了重复起见,请不要弄错设备标识符。 If you're unsure, ask.如果您不确定,请询问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在x86_64上,大6GB文件的read()失败 - read() of big 6GB file fails on x86_64 在 x86_64 linux 中重定位 2GB 以上的程序时出现链接器错误? - Linker error on relocating a program above 2GB in x86_64 linux? 无法使用新的[] / C ++ / Linux / x86_64分配2-4 Gb的RAM - Can't allocate 2-4 Gb of RAM with new[]/ C++/Linux/ x86_64 为什么我的汇编代码不起作用? 它应该在 Linux x86_64 上打开、写入和读取文件 - Why does my assembly code not work? It should open, write to and read a file on Linux x86_64 来自x86_64 Linux中的内联asm的Syscall? - Syscall from inline asm in x86_64 Linux? 如何在 ASM 中打印出两位数整数,( Linux NASM x86_64 ) - How do I print out two-digit integers in ASM, ( Linux NASM x86_64 ) 在 x86 (32bit) Linux 上启动 x86_64 代码,在 x86_64 CPU 上运行 - Start x86_64 code on x86 (32bit) Linux, running on x86_64 CPU Linux如何在x86-64中支持超过512GB的虚拟地址范围? - How does Linux support more than 512GB of virtual address range in x86-64? 我们如何判断指令来自 Linux x86_64 上的应用程序代码或库代码 - How can we tell an instruction is from application code or library code on Linux x86_64 是什么决定了在64位机器上构建的32位库是否需要x86_64或i386依赖? - What determines if a 32-bit library built on a 64-bit machine needs x86_64 or i386 dependencies?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM