个人工具
登录
查看“UbuntuHelp:RenameUSBDrive”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:RenameUSBDrive”的源代码
来自Ubuntu中文
←
UbuntuHelp:RenameUSBDrive
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/RenameUSBDrive}} {{Languages|php5}} == Editing ext2/ext3/ReiserFS/FAT32/NTFS Partition Labels == There are 4 programs you use to label a drive. The program used depends on the partition type. *For '''FAT32''' Partitions you use '''Mtools'''. *For '''NTFS''' Partitions you use '''ntfsprogs'''. *For '''ext2''' or '''ext3''' Partitions you use '''e2label'''. *For '''ReiserFS''' (v3) partitions you can use '''reiserfstune'''. Instructions for all are given below. === Editing FAT32 Partition Labels using mtools === I wanted to rename the fat32 partitions that get automounted when they are plugged in to the USB drive. Two were exactly similar external hard disk drives, and one was an iPod. The exactly similar hard disk drives (one each at home and work) were both getting mounted at /media/sda1 or sda2 etc, and it was impossible to distinguish one from the other easily. Also, I found that it wasn’t that easy to edit the partition labels for FAT32 partitions. So I thought I would summarize how I named my fat32 partitions to have consistent names. This has the benefit that when these drives are automounted, they will be at the location /media/partition-label, where partition-label is the label that you give the partition. Step by step instructions to re-label FAT partitions follow: ==== Instructions: ==== ==== 1) Install mtools: ==== <pre><nowiki> sudo apt-get install mtools </nowiki></pre> ==== 2) After the usb drive is automounted after plugging in, find out the device descriptor using: ==== <pre><nowiki> mount </nowiki></pre> and Note down where it says “sda2″ or similar ==== 3) Check what the label for the drive is currently: ==== <pre><nowiki> sudo mlabel -i /dev/sda2 -s :: </nowiki></pre> You may have to change sda2 to something else depending on what you got in step 2 above. Note that we're using the special "::" drive which allows us to specify the device descriptor on the command line; otherwise we'd have to edit ~/.mtoolsrc to assign a drive letter. ==== 4) Change the label to something pretty: ==== <pre><nowiki> sudo mlabel -i /dev/sda2 ::my-ipod </nowiki></pre> replace my-ipod with what you would like to name the usb drive ==== 5) Check if the label has changed: ==== <pre><nowiki> sudo mlabel -i /dev/sda2 -s :: </nowiki></pre> I got the following output – Volume label is MY-IPOD You’re all set!! The next time that partition gets automounted, it will be at /media/MY-IPOD === Editing NTFS Partition Labels using ntfsprogs === ==== Instructions: ==== ==== 1) Install ntfsprogs: ==== <pre><nowiki> sudo apt-get install ntfsprogs </nowiki></pre> ==== 2) After the drive is automounted after plugging in, find out the device descriptor using: ==== <pre><nowiki> mount </nowiki></pre> and Note down where it says “sda1″ or similar ==== 3) Change the label to something pretty: ==== <pre><nowiki> sudo ntfslabel /dev/sda1 newlabel </nowiki></pre> replace '''newlabel''' with what you would like to name the usb drive / Harddisk you may have to unmount the drive for this to work (system-> administration-> disks -> then under partitions for the hard disk hit disable). ==== 3) Check if the label has changed: ==== Restart your computer to see the label change if your harddrive is internal, and for usb just unplug/plug in USB again === Editing ext2 or ext3 Partition Labels using e2label === ==== Instructions: ==== ==== 1) After the drive is automounted after plugging in, find out the device descriptor using: ==== <pre><nowiki> mount </nowiki></pre> and Note down where it says “sda1″ or similar ==== 2) Change the label to something pretty: ==== <pre><nowiki> sudo e2label /dev/sda1 newlabel </nowiki></pre> replace '''newlabel''' with what you would like to name the usb drive / Harddisk you may have to unmount the drive for this to work (system-> administration-> disks -> then under partitions for the hard disk hit disable). ==== 3) Check if the label has changed: ==== Restart your computer to see the label change if your harddrive is internal, and for usb just unplug/plug in USB again === Editing ReiserFS v3 partition labels using reiserfstune === Note: this could work with ReiserFS 4 too, I have not tried. ==== 1) After the drive is automounted after plugging in, find out the device descriptor using: ==== <pre><nowiki> mount </nowiki></pre> and Note down where it says “sda1″ or similar; Or you could simply open '''gnome-system-monitor''' and take note of the mount point of the partitions you want to label. ==== 2) Unmount the partitions you want to label ==== For example: <pre><nowiki> sudo umount /dev/sda1 </nowiki></pre> ==== 3) Change the label to something pretty ==== (note: 16 characters maximum) <pre><nowiki> sudo reiserfstune -l 'johnny' /dev/sda1 </nowiki></pre> ---- === Credits === The information on this page was originally copied from http://ubuntu.wordpress.com/, and i believe it deserves to be in the wiki because the wiki is where i looked when i first had this problem. ==== ReiserFS part by Jeff ==== Just added this from my knowledge (which came from various forum posts and bug reports) CategoryDocumentation CategoryCleanup [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:RenameUSBDrive
。