个人工具

UbuntuHelp:RenamingExt3Partitions/zh

来自Ubuntu中文

Fideas讨论 | 贡献2007年5月19日 (六) 00:13的版本

跳转至: 导航, 搜索


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

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

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

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

  tune2fs -L NewLabel /dev/XXX
  

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

Once you have replaced NewLabel and /dev/xxx then press enter and it should write the new name to your drive. I found that it only changes after you restart, so once you restart your computer, your new hard drive (like my usb hard drive) will mount in /media/drivename, where drivename is the name you named it as (duh) and it should now appear on the desktop and elsewhere in the file manager as whatever you named it as. Enjoy.

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!