Samba, Cloning and Grub Examples
Given a shared directory from windows or a samba share, how do you mount it in Lunix and assign it to a specific user?
Assumption - A directory //snap/music is available to mount. Only the user stuart in workgroup asgard can access the share. We want to mount the directory for Linux user swells.
1) Become Super User
2) # smbmount //snap/music /tmp/library/ -o username=swells,workgroup=asgard,uid=swells,gid=swells,fmask=755,dmask=755
Cloning a Linux Drive
Assumption, you have a linux box that already boots, with space enough space to hold compressed tar files of the disk to clone. The orignal hard driver has two partition. Partition 1, is the swap, partition 2 contains the root files system we wish to clone.
Place the drive into /dev/hdb
Halt the computer, remove the original disk, and place a new disk into the system. Then format the new hard drive. We will place the swap into partition1 and the datafiles into parition 2.
Delete any existing partition using 'P' then 'D' commands.
Grub Cloning/Boot Issues
Assumption, after cloning a disk, grub sometimes has issues finding the kernel. The following can setup grub to find the kernel partitions again. (Assume we booted using partition /dev/hda5)
(Since we are using /dev/hdb, that is hd1.
Linux Distributions and Booting Options
I personally like working with NLD, and Redhat Distributions. I've had difficulties installing other distributions on various machine. Here are some tricks for those other distributions:
Linspire: Kept freezing when I tried to install it. It uses grub on its install disks, if you edit the grub boot and place xdriver=vesa onto the kernel options you can sometimes get it to boot that cd correctly. I currently recommend you avoid this distribution. Ubuntu is a good choice if your interested in simpler Linux distributions.
Linux Initrd files
Linux Initrd use to be files created using the dd and mount loop back options. Now to access the files you have to use cpio. If you have a ramdisk filesystem ready, you can create the initrd using the following:
find . | cpio -o -c | gzip -9 > /boot/newinitrd
You can extract the initrd using the following:
gzip -dc < /boot/initrd.img | cpio -i