特殊:Badtitle/NS100:RenamingExt3Partitions/zh

来自Ubuntu中文
跳到导航跳到搜索

{{#ifexist: :RenamingExt3Partitions/zh/zh | | {{#ifexist: RenamingExt3Partitions/zh/zh | | {{#ifeq: {{#titleparts:RenamingExt3Partitions/zh|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:RenamingExt3Partitions/zh|1|-1|}} | zh | | }}


重命名移动存储设备上的Ext3分区

通常情况下我们无需特意为某个分区指定名称,因为一般你作为挂载点的文件夹名称就会被指定为该设备的名称,但当被挂载的为移动设备上的某个分区时情况有所不同,主要是因为这类USB设备通常都是由系统自动挂载的,所以你不能为它指定具体的挂载点(这里说的不能只是指更改起来比较烦杂一些).

下面这些命令可以为分区指定名称,指定之后你在任意一台安装有linux的计算机上接上该设备,它都会显示出你为它指派的名称,挂载点则为/media/下同名文件夹<---这个不知道其他发行版上是不是通用的.

要为EXT3分区指定名称,运行下面的命令(并且填入正确的相关信息)

  tune2fs -L NewLabel /dev/XXX
  


Newlabel替换为你想用的名称,/dev/XXX替换为你实际的设备路径,查询路径的方法很多,你可以用gparted/qtparted这类的磁盘管理软件查看想重命名的分区对应的路径,也可以在终端中执行fdisk-l查询,这样查询只能显示出你所拥有的设备.加上sudo则会显示出所有的设备.

当你设置将Newlabel/dev/xxx设置为与你情况相符后按回车,新的信息就被写到该分区上了,不过我发现似乎要重启系统后才会生效,当你重启系统之后,你的新分区(比如我的移动硬盘)就会自动以新名称挂载到/media/newlabel下面,同时它在桌面和文件管理器里面都会以新的命名显示.

Renaming Ext3 Partitions on Internal or Non-Portable Hard Drives

To do this, you simply just have to change what folder it mounts to. Think of a good name, and then once you have thought of a new name that you want your drive or partiton to show up as, type this in the terminal: (substituting DRIVENAME for the name that you thought of)

  sudo mkdir /media/DRIVENAME
  

Then, after that command, type this in the terminal:

  sudo cp /etc/fstab /etc/fstab_backup
  gksudo gedit /etc/fstab
  

If you dont have or dont like gedit, substitute that command for your favorite text editor. Anyway, once it's open, look through the file and find the drive you want to rename (you should be able to find it by what path each drive is mounted to. Example, if you see "/dev/hde4 /home" , then you should be able to tell that /dev/hde4 is your /home partition)

Then, change the mount point to the folder that you just created. So, if you have /dev/hda2 mounted at /media/windows, you would delete "windows" and then type in the name that you thought of earlier so it would be /media/whatevernameyouthoughtof

Click save, then close the window. Reboot, and hopefully all went well and your partition should of mounted in the new folder and will now show up on your desktop with the name you specified.

If all did NOT go well, then you can restore the backup of the fstab file that i made you make. Simply type in the terminal:

  sudo cp /etc/fstab_backup /etc/fstab
  

then you should have the original fstab file that you had before you started any of this, and you should be able to try again.

Good Luck!