How to Move Your Home Directly to a New Drive, Samba Tips and More

Welcome back to Tech Support. Thanks to everyone who submitted questions for this issue. If you have new questions or want to suggest a program for our App Tips section, drop me a line at tech@linux-mag.com.

Welcome back to Tech Support. Thanks to everyone who submitted questions for this issue. If you have new questions or want to suggest a program for our App Tips section, drop me a line at tech@linux-mag.com.


I have a server that is running out of space on the /home partition. I purchased a new drive and want to know how to move my directory to the new disk without destroying my current working system.

This process can seem tricky at first, but after going through the steps, you’ll be able to manipulate your system to adjust to your growing needs.

1. Install the drive and make sure the kernel recognizes it. As root, run dmesg | more. This will list all of the kernel messages about various devices and filesystem attributes that have been seen at boot.

2. Partition the the new disk using mk2efs. For example, suppose you have added a new SCSI drive and you want to move the /home directory to its first partition. Format the partition with:

mk2efs -c /dev/sdb1

3. Create temporary mount points for the newly formatted partitions. For this example, you might create a home directory in your /mnt directory: mkdir /mnt/home.

4. Mount the new partitions to their temporary mounting point in the /mnt directory. For example,

mount -t /dev/sdb1

5. Now you can use either a file manager or the command line to copy the data from the current filesystem to the temporary mounted partition. For this example, you would copy everything from the /home directory into /mnt/home.

6. Rename the current directories (/home) to some other name like /oldhome to ensure that you still have the data before actually changing your systems partition to incor-porate the new ones. This gives you the chance to go back and fix everything if you really mess up.

7. Add the new partitions into your partition-configuration file, /etc/ fstab. For example, your /etc/fstab file might have the line:

/home/sdbext2defaults1 2

Once you have set up the /etc/fstab file, the system now knows where the corresponding mount points and data directories are located.

Reboot the system and do a df -h to see your new mounted-partition table with the size in megabytes. At this point, if the data was successfully copied, you can go ahead and delete the original partitions that you renamed in Step 6.


I’m trying to use wget to download a complete hierarchy of directories and files from a server, but am having trouble doing so.

wget is a free utility that can retrieve files from the World Wide Web, using either HTTP or FTP. You can run it interactively, or you can configure it to recursively copy a Web site and all of its contents without any supervision. This functionality makes it ideal for things like mirroring Web sites and searching the Web for specific files from various locations. Check out wget’s Web site at http://www.lns.cornell.edu/public/COMP/info/wget/wget_toc.html.

wget can download an entire hierarchy from a Web site, or a specified number of levels. If you want to download everything, the command might look like:

The -r 0 parameter sets the depth of the hierarchy retrieval to unlimited. Note that this option could slow the system to unsafe levels. You can avoid this by limiting the number of levels to be downloaded:

The -t switch controls the retry time limit.

wget -r 4 -t 10

This would download four levels of the Web site and sets the retry to 10 seconds. Another strategy would be to set the -w option to control the actual speed of the request to the server.

-w 10 tells wget to wait 10 seconds before retrieving the next document.


I added a Samba server to my Windows NT workgroup, and am having problems accessing it from machines running NT. I followed instructions on setting up user passwords and configuring the smb.conf, but cannot access the shares with any users. I am trying to implement cleartext password authentication. What am I missing?

This is a very common problem that occurs when integrating Samba in an NT environment. Your first step should be to run a command called testparm, which checks your Samba configuration file for syntax errors. If you find no errors, check to see that the kernel has the smbfs filesystem enabled. This is done easily with:

cat /proc/filesystems

If you don’t see the smbfs filesystem listed, see if your kernel has the filesystem built as a module, using:

ls /lib/module/2.2.x/fs/

If you see the module called smbfs.oin the list, use lsmod to see if it is actually loaded in the kernel. If it is, you are all set. If it’s not, you can do a modprobe smbfs to load it.

Make sure the server is running by using the command: ps aux | grep smb. If it doesn’t list the process, start the server. On a Linux-Mandrake system, you would start this service with the following commands:

cd /etc/rc.d/init.d
./smb start

At this point, you should see the two services: the smb service and the nmb service. Next, issue a command to make sure that it is actually functioning on the network. Assuming you are currently on the server itself, use the command smbclient -L localhost. If you are on a remote machine, replace localhost with the machine’s host name instead. This command should list the Sharename, type of resource, Servers name, Workgroup name, and the Master. If this information comes up correctly, you can assume that the basic configuration is working perfectly.

Now direct your attention to the problem that NT has with cleartext authentication. Previous to service pack 3, all NT machines were enabled to negotiate passwords using the cleartext format. However, after service pack 3, that option was eliminated. So if you tried to use it with a Samba server, it would try to authenticate, but it would disallow the request because it was not an authentication method that it understood. This is a very well-documented problem. See the Samba Web site (http://www.samba.org/) for more information about it. See also the Samba source code directory (samba/docs/textdocs/WinNT.txt).

To summarize this document, here is the solution to this problem. Remember that each client will need to be reconfigured in order for all of the Windows NT computers to work.

Run regedt32.exe or regedit. exe and then follow the path to the right key.


Add the following value:


Another way to implement this registry modification is through a file that comes with the Samba source code. Import the NT4_PlainPassword.reg filefrom the first subdirectory into the registry with the import registry function that can be found in the utilities menu.

After making the change, you will need to reboot the NT computer before the registry settings take effect. Now, once you get the Windows client, try logging in, and you should be authenticated with no problem.

App Tips

* QuickPPP I usually don’t have to much time to administer my home system, so this little program helped me out in a few situations, especially setting PPP chat scripts for family and friends. http://www.staticky.com/software.html

* Opera 4.0a Linux This ultra small (5 MB) Web browser is at least as fast as my version of Netscape, but it crashed it a few times on me during normal everyday operations. Worth checking out if you’re into alternative browsers — and alpha code! http://www.opera.com/linux/

* SWAT GUI skeptics take heed: Samba’s new graphical configuration tool is simply great. I highly recommend it for anyone who’s thinking about using Samba to turn their Linux box into an SMB server. http://www.samba.org/cgi-bin/swat/

Gaylen Brown is a senior consultant at Linuxcare, Inc. He can be reached at tech@linux-mag.com.

Comments are closed.