LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   mounting using LABEL= (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-using-label%3D-742846/)

ratcateme 07-26-2009 01:29 AM

mounting using LABEL=
 
i have just swapped all the HDDs around in my linux box originally i had a IDE drive for / and a 160GB SATA for data storage
i got a new 1TB SATA drive for data storage and i moved all my data to it.
then i reformatted my 160GB and copied / to it updated the MBR and grub and it now boots fine from from my 160GB the problem is i can't get it to mount the 1TB drive using Labels /etc/fstab looks like
cat /etc/fstab
Code:

LABEL=160Main          /                      ext3    defaults        1 1
tmpfs                  /dev/shm                tmpfs  defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                  /sys                    sysfs  defaults        0 0
proc                    /proc                  proc    defaults        0 0
LABEL=160Swap          swap                    swap    defaults        0 0
#/dev/sdb1              /mnt/sdb                ntfs-3g defaults        0 0
LABEL=1TB              /mnt/sdb                ntfs-3g defaults        0 0

and ls -l /dev/disk/by-label:
Code:

lrwxrwxrwx 1 root root 10 Jul 26 18:02 160Main -> ../../sda1
lrwxrwxrwx 1 root root 10 Jul 26 18:02 160Swap -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul 26 18:02 1TB -> ../../sdb1

now if i swap the comments on the last to lines of fstab it will mount but with the LABEL when i type mount /mnt/sdb i get:
Code:

ntfs-3g: Failed to access volume 'LABEL=1TB': No such file or directory

ntfs-3g 2009.4.4 integrated FUSE 27 - Third Generation NTFS Driver

Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2009 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson

Usage:    ntfs-3g [-o option[,...]] <device|image_file> <mount_point>

Options:  ro (read-only mount), remove_hiberfile, uid=, gid=,
          umask=, fmask=, dmask=, streams_interface=.
          Please see the details in the manual (type: man ntfs-3g).

Example: ntfs-3g /dev/sda1 /mnt/windows

Ntfs-3g news, support and information:  http://ntfs-3g.org

i have rebooted many times but nothing has changed.
is there an error in the way i configured the Labels.
something else i questioned was if ntfs-3g didn't support the LABEL=<label> syntax?

my system is Centos 5.3
Kernel 2.6.18-128.1.10.el5

Thanks Scott.

EmrldDrgn 07-26-2009 02:29 AM

*why isn't there a delete post option?*

ratcateme 07-28-2009 12:53 AM

any one else have any ideas?
i can live with this but i would like to make it work so if i ever want to use Labels later on i can no worries

Scott.

karamarisan 07-28-2009 01:21 AM

I can tell you that should work because I mount my Windows partition with this method. If I'm not mistaken, mount resolves the label and passes the device file to ntfs-3g - looks like your problem is that mount isn't doing that and is just passing the raw thing, which poor ntfs-3g obviously can't do shit with. So I'm not sure what's wrong here. Try `ntfslabel /dev/sdb1` and make sure it returns what we think it should. By the way, try the [ CODE ] tags - makes this kind of thing infinitely easier to read.

On another note, jesus christ, do you have 160 GB of swap?

ratcateme 07-28-2009 02:40 AM

well i had tried to check that with the ls -l /dev/disk/by-label
but as predicted: ntfslabel -f /dev/sdb1
Code:

The device /dev/sdb1, is mounted.
Forced to continue.
1TB

so the label is "1TB" like i had set it
i can see what you are saying about it not changing LABEL=1TB to /dev/sdb1 for ntfs-3g
i will do some more Googling to see if i can get any more info on this

also i don't have 160GB of swap i have a 160GB drive with 2 partitions the / and a swap it is really only about 1.5GB

Scott.

karamarisan 07-28-2009 03:13 AM

Unfortunately, I can't see anything wrong with your configs - thought there might be an extra space or something, but nope, all looks clean. One other thing I can suggest you try that may help you figure this out and is (IMHO) a superior alternative to LABEL= mounting is UUID= mounting. You can find your drive's UUID (which for NTFS isn't a real UUID, but whatever) under /dev/disk/by-uuid. Perhaps if you try that, whether it works or fails will tell you something about the problem. Best of luck, and please come back to this thread and let us know when you figure it out. You never know who might have the exact same problem some day.

Electro 07-28-2009 03:29 AM

I suggest use EXT3 unless you desperately need NTFS. Since there is already an IFS driver for Windows that supports EXT2, there is no need to use NTFS. IMHO using ntfs-3g in Linux is still experimental because some Linux programs has some problems with NTFS.

If you insist on using NTFS for the file system for your terabyte hard drive, you can try to change the mount script for ntfs-3g. It might be called mount.ntfs-3g. I suggest double check if the label 1TB is proper label.

ratcateme 07-28-2009 05:58 AM

thanks Electro really the only reason i am using NTFS is that depending on how things work out i might put it back in one of my XP boxes
now that you have pointed out the Windows can support EXT3 i will reformat tonight YAYA more wasted time!

just a question regarding mount should it turn LABEL=1TB into /dev/sdb1 or should that be done by the ntfs-3g command that is called
also i checked /sbin/mount.ntfs-3g and it is linked to /usr/bin/ntfs-3g and that looks all good


Scott.

Electro 07-28-2009 05:01 PM

The ntfs-3g should be able to mount using labels if it is written properly. If it is not remove the symbolic link for mount.ntfs-3g and write a bash script named mount.ntfs-3g that translates the label into the device node and then mounts using ntfs-3g utilities.

I think you specify an illegal label for your NTFS partition. When I specify labels, I do not use a number as the first character in the label. I suggest change the label, so it does not have a number for the first character. If it works after you change the label to not have a number for the first character, then you should send a bug report to ntfs-3g about the label limitation. At this point, you should upgrade ntfs-3g to the latest stable version.

Actually the EXT2 IFS is a Windows drivers that provides support for EXT2 that gives the ability to access EXT2 partitions. Since EXT3 is EXT2 plus journal, formatting partition as EXT3 is OK when using in Windows which has EXT2 IFS installed. When you boot into Linux, run the file system utility to update the journal.

ratcateme 07-29-2009 02:20 AM

i relabeled the drive to TB reboot and updated fstab but still same problem
i wont bother making a mount.ntfs-3g i think i will just change it to EXT3

Thanks for the help
Scott.


All times are GMT -5. The time now is 03:43 PM.