linux系统下修改磁盘名称
资料:查看当前所有分区sudo fdisk -l查看所有分区的磁盘格式df -T先卸载要修改名称的分区sudo umount /dev/sda2修改名称sudo ntfslabel /dev/sda2 newname备注:fuseblk格式可按照NTFS格式的来修改名称。根据不同的磁盘分区类型,分别有3个程序可供选择Mtools 适用于 FAT32 格式分区ntfsprogs 适用于 NTFS 格
资料:
- 查看当前所有分区 sudo fdisk -l
- 查看所有分区的磁盘格式 df -T
- 先卸载要修改名称的分区 sudo umount /dev/sda2
- 修改名称 sudo ntfslabel /dev/sda2 newname
- 备注:fuseblk格式可按照NTFS格式的来修改名称。
根据不同的磁盘分区类型,分别有3个程序可供选择
Mtools 适用于 FAT32 格式分区
ntfsprogs 适用于 NTFS 格式分区
e2label 适用于 ext2和ext3型格式分区
实践:
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
udev devtmpfs 8053684 0 8053684 0% /dev
tmpfs tmpfs 1620028 1684 1618344 1% /run
/dev/nvme0n1p2 ext4 490691512 77225344 388470688 17% /
tmpfs tmpfs 8100124 80996 8019128 1% /dev/shm
tmpfs tmpfs 5120 4 5116 1% /run/lock
tmpfs tmpfs 8100124 0 8100124 0% /sys/fs/cgroup
/dev/nvme0n1p1 vfat 523248 7984 515264 2% /boot/efi
tmpfs tmpfs 1620024 16 1620008 1% /run/user/1000
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo fdisk -l
[sudo] password for wangbin:
Sorry, try again.
[sudo] password for wangbin:
Disk /dev/nvme0n1: 476.96 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SAMSUNG MZVLB512HBJQ-000L7
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: BB22534C-596A-4776-94F7-EEC9D104C814
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 1000214527 999163904 476.4G Linux filesystem
Disk /dev/sda: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA DT01ACA2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 288FF796-48F0-4938-9D75-2E12F8EA7C07
Device Start End Sectors Size Type
/dev/sda1 2048 628413643 628411596 299.7G Microsoft basic data
/dev/sda2 628414464 1258923211 630508748 300.7G Microsoft basic data
/dev/sda3 1258924032 1888551975 629627944 300.2G Microsoft basic data
/dev/sda4 1888552960 2516670954 628117995 299.5G Microsoft basic data
/dev/sda5 2516672512 3146216569 629544058 300.2G Microsoft basic data
/dev/sda6 3146217472 3907028991 760811520 362.8G Microsoft basic data
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
udev devtmpfs 8053684 0 8053684 0% /dev
tmpfs tmpfs 1620028 1692 1618336 1% /run
/dev/nvme0n1p2 ext4 490691512 77229736 388466296 17% /
tmpfs tmpfs 8100124 72700 8027424 1% /dev/shm
tmpfs tmpfs 5120 4 5116 1% /run/lock
tmpfs tmpfs 8100124 0 8100124 0% /sys/fs/cgroup
/dev/nvme0n1p1 vfat 523248 7984 515264 2% /boot/efi
tmpfs tmpfs 1620024 16 1620008 1% /run/user/1000
/dev/sda6 fuseblk 380405756 104696 380301060 1% /media/wangbin/D
/dev/sda5 fuseblk 314772028 102692 314669336 1% /media/wangbin/0FC80AF80FC80AF8
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
udev devtmpfs 8053684 0 8053684 0% /dev
tmpfs tmpfs 1620028 1692 1618336 1% /run
/dev/nvme0n1p2 ext4 490691512 77229764 388466268 17% /
tmpfs tmpfs 8100124 75772 8024352 1% /dev/shm
tmpfs tmpfs 5120 4 5116 1% /run/lock
tmpfs tmpfs 8100124 0 8100124 0% /sys/fs/cgroup
/dev/nvme0n1p1 vfat 523248 7984 515264 2% /boot/efi
tmpfs tmpfs 1620024 16 1620008 1% /run/user/1000
/dev/sda6 fuseblk 380405756 104696 380301060 1% /media/wangbin/D
/dev/sda5 fuseblk 314772028 102692 314669336 1% /media/wangbin/0FC80AF80FC80AF8
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
udev devtmpfs 8053684 0 8053684 0% /dev
tmpfs tmpfs 1620028 1692 1618336 1% /run
/dev/nvme0n1p2 ext4 490691512 77229668 388466364 17% /
tmpfs tmpfs 8100124 70652 8029472 1% /dev/shm
tmpfs tmpfs 5120 4 5116 1% /run/lock
tmpfs tmpfs 8100124 0 8100124 0% /sys/fs/cgroup
/dev/nvme0n1p1 vfat 523248 7984 515264 2% /boot/efi
tmpfs tmpfs 1620024 16 1620008 1% /run/user/1000
/dev/sda6 fuseblk 380405756 104696 380301060 1% /media/wangbin/D
/dev/sda5 fuseblk 314772028 102692 314669336 1% /media/wangbin/0FC80AF80FC80AF8
/dev/sda4 fuseblk 314058996 101372 313957624 1% /media/wangbin/0FC805C20FC805C2
/dev/sda3 fuseblk 314813968 102692 314711276 1% /media/wangbin/0FC719770FC71977
/dev/sda2 fuseblk 315254372 103456 315150916 1% /media/wangbin/0FC714950FC71495
/dev/sda1 fuseblk 314205796 793396 313412400 1% /media/wangbin/5C2E40A92E407E50
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo umount /dev/sda5
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo ntfslabel /dev/sda5 E
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo umount /dev/sda4
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo ntfslabel /dev/sda4 F
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo umount /dev/sda3
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo ntfslabel /dev/sda3 G
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo umount /dev/sda2
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo ntfslabel /dev/sda2 H
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo umount /dev/sda1
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ sudo ntfslabel /dev/sda1 I
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)