Help me use a external USB drive for my /home directory
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Help me use a external USB drive for my /home directory
Ok be patient here. I am really new to Linux and my husband who is much better than me is really too busy to help me. I have avoided these forums for a while because he has been able to help me in the past. I am a homeschooling mom who is using moodle on a Red Hat Fedora Core 10 Linux server for my kids to access their school work from. It is on a really old hardware system that cannot boot from USB so we cannot put the operating system on the terabyte usb drive we have. I need to move the /home directory (because moodle is located in the /home directory and has to be according to my husband I don't understand this because he set it up) to the USB drive. However, it seems from what assistance my husband was able to e-mail to me that fedora is not recognizing the USB drive before it runs fstab and that is causing the hiccup it is having. How can I get Linux to recognize the USB drive before it loads fstab or whatever I have to do to be able to migrate my /home directory to the terabyte drive in order to make moodle work from there. I really need the storage space in order to put up the work for the kids. I have three kids, all in different grades so I have a lot of very large educational models. Any help anyone can give would be appreciated. Also please remember that I am not that familiar with Linux so please do not assume that I know how to find things or do things.
do this at first so i can give you some pointers, because if /home directory if in a different partition you will need only to change it on fstab and will be easy, but before that we need to make sure that the USB drives boot automaticly.
Last edited by pliqui; 04-17-2009 at 05:18 PM.
USB devices not being mounted at boot is a fairly common problem that has to do with the amount of time it takes the kernel to recognize a removable device in relation to the time it allocates for detecting them.
There are a number of ways in which you can fix this, but it is hard to say which one would be the best without a little more information on how Moodle starts and what your level of involvement is on how the server boots and works.
For instance, if the USB drive is put into /etc/fstab and simply isn't becoming active in time for it to be mounted, you could run the command "mount -a" after the machine has booted which will go back and mount everything in fstab (but this time the device would have had enough time to start).
If the server is something that is only powered up once and awhile this could be an acceptable solution, but more likely you would want to have this as a scripted event that happens a minute or so after boot.
Once the drive has mounted as /home, you would be able to log in with a normal user account. Before this you would be able to use the root account, or run the command through a script.
Tell your husband to come home once and a while for kids sake.
Also, it is highly likely you can take the drive out of it's USB enclosure and install it directly into the old box, there is software that will allow an old computer to see and use a terabyte drive. All/most hard drive manufacturers offer this software for free, they all use Ontrack. Use "Ontrack disk management" as keywords in a Google search to find links to your hard drive manufacture's disk management page. Because if the USB drive will be permanently tethered to the computer as it contains the /home directory, save yourself some headaches and install it directly, you'll have the advantage of faster seek/transfer speed also.
Then move the home directory to it and add it to fstab and everything is normal.
This would be the best approach unless you need the drive to be portable. Hard drives are the cheapest form of storage these days.
Last edited by Junior Hacker; 04-19-2009 at 12:12 AM.
Also, it is highly likely you can take the drive out of it's USB enclosure and install it directly into the old box, there is software that will allow an old computer to see and use a terabyte drive.
As the computer is older, it is going to be using IDE while a 1 TB drive is almost certainly going to be SATA. You would need to use a PCI SATA controller to overcome this, but that would only be slightly better than over USB unless you got a pretty good controller (at a likely impractical cost). Installing and configuring said controller would also be considerably more difficult than using an external drive, and the goal here is to make this installation as simple as possible.
Though you don't need any special software to use a drive of that size with an older system. Assuming the drive interfaces were the same and you could physically connect the large drive to your system, Linux ignores the BIOS and directly queries hardware to get their specifications. The BIOS doesn't need to detect the drive for Linux to use it, in fact, you can disable all of your drives (other than the boot volume, obviously) in BIOS and the Linux kernel will pick them all right up.
The 137 GB limit is an issue with LBA addressing in BIOS and additionally some poor implementation on the part of Microsoft for older releases of Windows.
Then add "mount -a" to /etc/rc.local, may even need to add a sleep time value ahead of it but probably not, I would just add the mount -a command and try it this way first. I would think commands in /etc/rc.local would be run before GDM logon screen appears.
Personally, if the computer can accommodate the drive, if it has SATA or the drive is actually IDE, or due to the low cost of new drives where you can purchase one to install into the computer, this would be a far better approach for a server. Servers generally run for extended periods of time. A computer has case fans, CPU fans, either/or or both, the point I'm getting at is that there is cooling in a computer where as there is none in USB enclosures. And if /home is going to be on this drive, it has to run whenever the computer is running.
Here at LQ we are constantly bombarded with cries for help to recover data from failed servers/computers. And most of these cases you'll find that the owner was pinching the all mighty dollar to start with, after the computer crashes is when they finally go out and buy other drives to do the backup they should have done before the computer crashed. What this means is that they actually could afford the drives all along as we've never heard of anyone telling us they were forced to make a loan in order to purchase them.
I'm only guessing here, but I have a feeling this terabyte drive was originally purchased with backup in mind, and because of it's size and the fact you don't need a terabyte for /home, now you are thinking of using it for both backup and /home, or just /home. One way or another, if this is your intention, due to obvious reasons, you may well end up shaking your head wondering why you did what most people tend to do...pinch the all mighty dollar.
Almost same problem, external device wan't mount on /home during startup.
like stated in the title, I'm trying to mount an external USB drive on /home during startup. My internal drives becoming to small, I would like to use this external drive as /home that can travel too (and share my music and videos with friends). Backup for this drive will come after this problem will be resolved (rsync with another external drive, internal drives (2) containing multiple OSes and backup of my regular systems).
Device = LaCie Rugged 500GB USB2.0
with 2 partitions (a big one formated in ext3, a very small one formated in fat32 and containing ext2fsd.exe and equivalent for mac).
To prevent udev naming problems (not relying on sda1 and sda2 names) I created two rules in /etc/udev/rules.d/10-local.rules :
since yesterday I found some (quirky) solutions...
I realized that most of the graphical login programs (xdm, gdm?, ...) propose to start some programs before/after run.
I use qingy (
a replacement for getty. Written in C, it uses DirectFB to provide a fast, nice GUI without the overhead of the X Windows System
) and added this :
if [ -z "$(mount | grep $home)" ]; then
to my "/etc/qingy/pre_GUI.sh" and changed my "/etc/fstab" so that my drive mounts on "/home/".
This works but still is a quirky solution. I really would like to have /dev/LaCie_home being created when udev populates /dev/ (I still have the warning during startup).
To prevent accidental unmount from my filer (PcmanFM) which shows (thanks to hald and like almost every filer) usb drives an make mounting and unmounting them easy, I added to "/usr/share/hal/fdi/policy/10osvendor/" following file (99-LaCie_homeDir) :
and thanks for your post.
The UUID hint is a good one in comparison with my udev.rules
But even this way I still have the annoying warning when booting up : "mount: special device UUID=####### does not exist" and the drive will not be mount during startup. It is like my drive is "not attached" during the whole booting process, I really don't understand what is happening...
So, now I target my drive with his UUID in my "fstab" file.
My "pre_GUY.sh" still looks like this :
if [ -z "$(mount | grep /home)" ]; then
because this :
if [ -z "$(ls -l /dev/disk/by-uuid/ | grep $home_uuid)" ]; then
doesn't work... Which is a bit annoying
I removed the udev.rules. "Hal foo.fdi rules" stays to prevent unfortunate GUI (un)mount. This make my system neater, but still not perfect , I still hope being able to mount this external drive during boot time...
Have a nice day, and still thanks for your suggestions.
I too have an older machine and mount an external drive at boot time, albeit for backup, not as /home.
I have the mount command in an initrd that gets loaded at boot time. In slackware it is pretty straight forward to modify/create an initrd; you probably know how to do that in Fedora or Gentoo. It's probably easier than messing with HAL and udev though not as elegant or flexible to be sure.
Last edited by mostlyharmless; 01-15-2010 at 03:11 PM.
About what /home is supposed to be, even if I understand it, for some irrational reasons I will stay to my first decision.
About adding a script to /etc/init.d , I don't think this is the solution. The problem seems to be that my drive is not up when udev is populating, and even when "localmount" (an init script) is run the drive has not been recognized. But when a forced fscheck occurred during boot, the "UUID=##### drive not found" warning didn't happen. So I suppose that it is all about time to startup my drive, or to populate completely /dev by udevd.
There is an udev option in /etc/conf.d/udev which should delay the process of uevents at boot "udev_settle_timeout" which default is 60. Assuming that it would be seconds, I tried to delay for about 10 minutes just to see what happens. Result, nothing, the boot process don't even seems to be interrupted. And I don't find any documentation or anything about what this option should really do.
Honnestly, I am not desperate, my system boots fine, my pre_GUI.sh script takes care of my mounts ect.. But It would be nice to understand what is happening... Any clues?