Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Reply
Old 07-06-2009, 10:03 PM   #1 (permalink)
 
Monster Techie

Join Date: Sep 2005

Location: /home/jason

Posts: 1,821

Jayce will become famous soon enoughJayce will become famous soon enough

Send a message via AIM to Jayce
Default Re: Switching from XP to Ubuntu, how to?

The reason you got the errors with the mount command is because you didn't complete the command. You told Linux to "Hey! Ubuntu! Mount this!.........."

Ubuntu sat there wondering what "this" was.

A completed mount command looks like this:

sudo mount /dev/sdb1 /media/localbackup

Breaking down the command piece by piece, we have several sections. I'm not sure how much you understand by this command but I figured if thirty seconds of typing helps ya out, awesome. If you already know this, so be it.

Sudo - Root user. Superuser priviledges. Think of it as you telling the computer "Just ****ing do what I tell you."

mount - The actual "command" that is issued.

/dev/sdb1 - dev is known as "device" and sdb1 is the hard drive ID. You can see your hard drive ID in GParted (Gnome Partition Editor - weapon of mass destruction, be careful with it) along with the command "sudo fdisk -l" in terminal.

/media/localbackup - the destination. You create this destination with the "sudo mkdir" command (mkdir = make directory). Example - sudo mkdir /media/localbackup. This issues a folder called "localbackup" to be within the "media" directory. Localbackup is simply the name of the mount point. Customize this to what YOU would like. Localbackup is just an example from my system.

[NOTE] - Always remember - source first, destination second. You are mounting /dev/sdb1 (source) to /media/localbackup (destination), that's why they appear /dev/sdb1 /media/localbackup and not the other way around.

So now we've dissected the "sudo mount /dev/sdb1 /media/localbackup" command. You can customize this command to whatever you want to do. Is your drive /dev/sdc1? No problem. Plug that in place of /dev/sdb1. Along with your mount point (/media/localbackup), name it whatever you want when you create it.

So where are we at now? You have the hard drive, you have the mount point, but now you need to tell the system to automatically mount the drive each time you boot up so its always accessible. That's what /etc/fstab is (fstab is file system table, located in the /etc directory).

You need to edit this file, using an editor such as gedit. I use gedit for almost everything.

Command is - sudo gedit /etc/fstab

And presto. Your fstab file shows up. This is where you add the entry for your drive. This is very easy, but make sure you do it accordingly to what the Ubuntu documentation says. Otherwise it won't mount when you boot up.

This is the entry that Ubuntu suggested:

/dev/sdb1 /media/mynewdrive ext3 defaults 0 2

Customize this to YOUR needs. Is /dev/sdb1 your drive? If not, change it. What is your mount point? Is it /media/mystuff? If so, change it here. The section where ext3 is is simply the file system. If you are running Ubuntu ONLY, ext3 should be just fine. ALL of my drives use ext3. If you are running another file system such as fat32, it should be noted here, but I believe fat32 is noted as "vfat", however I'm not positive. ALSO - Please note, there is a newer file system out known as ext4 (newer than ext3). You can use that if you wish. I personally chose not to until the future release of Ubuntu this fall due to the fact ext4 is new and I'd rather wait a bit. Just keep in mind to tag in /etc/fstab whatever file system is on that hard drive.

Personally, what I do is I add a comment tag in there too so I know what I'm doing. This may or may not be something you want to do, but I like doing this with having 4 drives in my PC. The first backup drive in my system shows up as follows in /etc/fstab:

#BACKUP DRIVES
#Local Backup Drive
/dev/sdb1 /media/localbackup ext3 defaults 0 2

Anything before # in that particular line doesn't show up, so I use the #EnterTextHere feature so I can keep organized with my stuff.

Now... where are we at now? You have a mount point. You have the drive. You have /etc/fstab adjusted accordingly. What about permissions? I wouldn't advise messing with permissions on the drive unless you have any issues accessing it locally. However, I adjusted my permissions on my drives in a certain manner since I have network users who attach to some of the drives. The important thing is that you are the owner. If you right click on the mount point (AFTER it is mounted, that is) and hit the permissions tab you can see what's listed there. Are you the owner? If it's root, I suggest changing it.

sudo chown -R jayce /media/localbackup

sudo - root
chown - change ownership
-R - recursively
jayce - whatever user you want to own that folder
/media/localbackup - directory you're applying these changes to

Now... if you followed these steps accordingly... whenever you boot, your drive should be easily accessible in the /media/WhateverYouNamedIt directory. Unlike Windows where it just plops the drive in (which is convenient, but far less customizable) you have more control over what your computer is doing. In my case, I have 3 backup drives. 1 for me, and 2 for network storage for other computers. I need to tell these drives apart, so I mount them to specific shares. With Windows, I suppose I could just have their Local Disk - D or Local Disk - E drives to tell them apart, but it's much easier to look at my disk usage analyzer and see drives labeled "Localbackup" and "Storage" and "Storagebackup".

So overall, this is what you did.

-Create a mount point for your drive.
-Added the hard drive to /etc/fstab to auto-mount upon system bootup.
-Changed ownership if the mount point, though, this may not be needed if you are already the owner.

This is a process that honestly takes about 30 seconds to do if you have done it before. Doing it the first time can seem a little cumbersome and sketchy. Another thing to throw out there is that if your drives are plugged in to your system when you install Ubuntu, this entire process can be automated. When you hit the partitioning section (using the manual partition mode option) you can select each drive accordingly and select its mount point. It'll add all of the nitty gritty details to /etc/fstab automatically for you, as we did manually above. Of course, please note, if you are installing Ubuntu on drive "A" and you don't want drive "B" formatted, which has data on it, make sure you don't check the "format" option for it. But don't worry about that until you get to that point.

For now, this should get you rolling. Post back if you have any issues.

Last edited by kmote; 07-08-2009 at 08:17 AM.
Jayce is offline   Reply With Quote
Old 07-08-2009, 07:11 AM   #2 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default Re: Mounting drives under linux.

Jayce - superb I have split this to it's own thread and made it a sticky.
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline   Reply With Quote
 
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fundamental Differences Between Linux and Windows Osiris Linux Tips and Tricks 0 12-11-2008 06:13 PM
Useful list of Linux websites. tribalsun Linux, BSD, other *nixes & Open Source Software 33 11-30-2008 12:35 AM
The five best things in Linux 2.6.27 Osiris Linux Tips and Tricks 2 10-21-2008 09:13 PM
New with Linux MindHacked Linux, BSD, other *nixes & Open Source Software 8 04-16-2008 09:18 PM
Want to make the move to Linux for good...advice? BoysNightOut Linux, BSD, other *nixes & Open Source Software 25 05-16-2007 11:40 AM