Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old March 4th, 2006   #1
magisterludi
5 Cups of Ubuntu
 
Join Date: Mar 2006
Beans: 34
Ubuntu 6.06
Howto: Mount you external ext disk using volume labels

Having more than one external drive makes it difficult to mount them at the same point if you plug and unplug this drives in different orders.

For example the first external usb drive attached will always get the device /dev/sda the second /dev/sdb, etc

a fstab line
like
Code:
/dev/sda1       /media/usb120gb   ext3 defaults                 0       0
/dev/sdb1       /media/usb300gb   ext3 defaults                 0       0
won't mount your 120gb drive at /media/usb120gb if you attach the 300gb drive first.

At least with following filesystems you can easily get this fixed:
ext2, ext3, XFS, JFS,Reiserfs.

Just do
Code:
tune2fs -L usb120gb /dev/sda1
tune2fs -L usb300gb /dev/sdb1
This gives you partition/disk a label.
Check with: dumpe2fs

Then you can (auto)mount them the right way using following fstab:
Code:
LABEL=usb120gb /media/usb120gb ext3 defaults 0 0
LABEL=usb300gb /media/usb300gb ext3 defaults 0 0
magisterludi is offline   Reply With Quote
Old March 4th, 2006   #2
dcstar
Ubuntu addict and loving it
 
Join Date: Feb 2005
Location: Melbourne, Australia
Beans: 7,085
Ubuntu 9.04 Jaunty Jackalope
Re: Howto: Mount you external ext disk using volume labels

Quote:
Originally Posted by magisterludi
......
At least with following filesystems you can easily get this fixed:
ext2, ext3, XFS, JFS,Reiserfs.

Just do
Code:
tune2fs -L usb120gb /dev/sda1
tune2fs -L usb300gb /dev/sdb1
This gives you partition/disk a label.
Check with: dumpe2fs

Then you can (auto)mount them the right way using following fstab:
Code:
LABEL=usb120gb /media/usb120gb ext3 defaults 0 0
LABEL=usb300gb /media/usb300gb ext3 defaults 0 0
This can also be used for your "Internal" partitions, the result is on boot-up the fsck messages refer to the disk label rather than the /dev identifier.

Also, I would recommend that "dumpe2fs" be used with the "-h" parameter to cut down on the screen output.

Very handy HOWTO.
__________________
Regards, David.

The Forum search function is useful for immediate help (give it a try).
Please mark your thread as "Solved" (using the Thread Tools) when appropriate.
dcstar is offline   Reply With Quote
Old March 18th, 2006   #3
dartmusic
A Carafe of Ubuntu
 
Join Date: Mar 2006
Location: San Francisco
Beans: 106
Ubuntu 9.04 Jaunty Jackalope
Re: Howto: Mount you external ext disk using volume labels

THIS is exactly what I was looking for! Who knew it would be this simple?

OK...maybe not SO simple! I am running Kubuntu Breezy on an HP zd7015 notebook and I have three external USB disks. Two of these disks are formatted with ext3 filesystems, while the third is formatted with the vfat/fat32/whatever filesystem. For some reason I can't get fstab to recognize the label for this drive.

Here is the error I get when trying to set it again with tune2fs:

rickstone@kubuntu:~$ tune2fs -L Media_Drive /dev/sdc1
tune2fs 1.38 (30-Jun-2005)
tune2fs: Permission denied while trying to open /dev/sdc1
Couldn't find valid filesystem superblock.

Here is my fstab file:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda3 / reiserfs notail,atime,auto,rw,dev,exec,suid,nouser 0 1
/dev/hda1 /media/hda1 ntfs defaults,uid=0,gid=0,auto,rw,nouser 0 0
/dev/hda2 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
LABEL=MEDIA_DRIVE /media/Media_Drive vfat ,uid=1000,gid=1000,auto,rw,users 0 0
LABEL=Big_Boy /media/Big_Boy ext3 ,atime,auto,rw,nodev,noexec,nosuid,users 0 0
LABEL=Little_Big_Boy /media/Little_Big_Boy ext3 ,atime,auto,rw,nodev,noexec,nosuid,users 0 0
/dev/sdd2 /media/ipod vfat ,uid=1000,gid=1000,auto,rw,users 0 0

Any ideas?

Thanks in advance and thanks again for a great howto!
dartmusic is offline   Reply With Quote
Old March 18th, 2006   #4
sbassett
Way Too Much Ubuntu
 
sbassett's Avatar
 
Join Date: Mar 2005
Location: PA, USA
Beans: 180
Ubuntu 7.10 Gutsy Gibbon
Send a message via AIM to sbassett Send a message via Yahoo to sbassett
Re: Howto: Mount you external ext disk using volume labels

To the best of my knowledge, vfat (fat32) does not support labeling, as per the output:

Code:
rickstone@kubuntu:~$ tune2fs -L Media_Drive /dev/sdc1
tune2fs 1.38 (30-Jun-2005)
tune2fs: Permission denied while trying to open /dev/sdc1
Couldn't find valid filesystem superblock.
tune2fs is try to place ext2 (or ext3) parameters on this filesystem.
__________________
OOOOhhh! The Internet
My Dumb Site
My Dumb Forums
My Dumb Blog
sbassett is offline   Reply With Quote
Old March 18th, 2006   #5
magisterludi
5 Cups of Ubuntu
 
Join Date: Mar 2006
Beans: 34
Ubuntu 6.06
Re: Howto: Mount you external ext disk using volume labels

As said before this is only for these filesystems:
ext2, ext3, XFS, JFS,Reiserfs not vfat, ntfs, hfs+, etc.

But there are other ways to accomplish it more generically:
Here is a link which may help you:
http://gentoo-wiki.com/HOWTO_Customi...digital_camera
magisterludi is offline   Reply With Quote
Old March 20th, 2006   #6
dartmusic
A Carafe of Ubuntu
 
Join Date: Mar 2006
Location: San Francisco
Beans: 106
Ubuntu 9.04 Jaunty Jackalope
Re: Howto: Mount you external ext disk using volume labels

Thanks for the responses. I have to say that the UDEV wiki bit I think is a little over my head as I couldn't get it to work.

SO...what I'm wondering is why I couldn't simply replace this line:

LABEL=MEDIA_DRIVE /media/Media_Drive vfat ,uid=1000,gid=1000,auto,rw,users 0 0

with this:

UID="the_UID_of_this_drive" /media/Media_Drive vfat ,uid=1000,gid=1000,auto,rw,users 0 0

?

So, I did. I found the UID of the drive (can't remember now the command but it was something in the UDEV wiki listed above) and it doesn't work. I guess I don't understand why I couldn't use another parameter in place of LABEL? I didn't type the UID in quotes as I did above, either. I'm at work, so not in front of my (home) computer with the appropriate info. Is there another unique parameter that I could use in place of LABEL, or is this something that is simply not going to work with a vfat drive? I kind of want to keep one drive formatted as such, as I still have to have XP on this machine for music writing/recording stuff.
dartmusic is offline   Reply With Quote
Old March 20th, 2006   #7
dartmusic
A Carafe of Ubuntu
 
Join Date: Mar 2006
Location: San Francisco
Beans: 106
Ubuntu 9.04 Jaunty Jackalope
Re: Howto: Mount you external ext disk using volume labels

Like I said above, I'm not at home, but I did run across this article:

http://ubuntu.wordpress.com/2006/03/...-using-mtools/

Might be the answer? Anybody tried this?
dartmusic is offline   Reply With Quote
Old March 23rd, 2006   #8
lyly
Just Give Me the Beans!
 
lyly's Avatar
 
Join Date: Feb 2005
Location: Switzerland / Hong Kong
Beans: 68
Ubuntu Breezy 5.10
Re: Howto: Mount you external ext disk using volume labels

I have a reiserfs external disk and edit the label with reiserfstune (Breezy). Then I tried to add

LABEL=MyDisk /media/MyDisk reiserfs defaults 0 0

in /etc/fstab. The problem is that I cannot write on the mounted disk, unless I am root...

I would like any user on the computer to be able to write on the disk root... Which options should I add? Thx
__________________
BOFH excuse:
The cause of the problem is: Bad user karma.
lyly is offline   Reply With Quote
Old March 23rd, 2006   #9
magisterludi
5 Cups of Ubuntu
 
Join Date: Mar 2006
Beans: 34
Ubuntu 6.06
Re: Howto: Mount you external ext disk using volume labels

With the disk mounted do:

Code:
chown -R root:yourusergroupname /media/thenameofthemountedreiserfs
chmod -R g+w /media/thenameofthemountedreiserfs
magisterludi is offline   Reply With Quote
Old March 23rd, 2006   #10
dartmusic
A Carafe of Ubuntu
 
Join Date: Mar 2006
Location: San Francisco
Beans: 106
Ubuntu 9.04 Jaunty Jackalope
Re: Howto: Mount you external ext disk using volume labels

Whoa Nelly!

What is the "chmod g+w" bit? Can you explain? I'm having permissions problems on just ONE of my reiserfs drives...of course the drive that holds my music collection and I need to make changes to tags fairly often and get the wonderful glass-breaking sound an an error popup that actually doesn't tell me what the error is!
dartmusic is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:31 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry