Technical notes and tips for Macintosh, Linux, and Windows

These are some the technical notes we’ve accumulated as we’ve worked with Macintosh, Linux, and Windows systems. We’ll be adding more shortly. Some of these may be obvious to you, others less-so. In any case, we hope they save you some time.

We make no warranties or guarantees about these notes. Always make a backup of your system before trying something potentially damaging. If you see any errors, or wish to offer suggestions, please send us a note.

Linux

Creating an ISO image

mkisofs -o filename.iso -J -r -v -V volumename /path/file_or_folder

Mounting an ISO Image File

mount -o loop -t iso9660 filename.iso /mnt/tmp

Burning a CD

Determine the device identifier to be used in the cdrecord statements below:

cdrecord -scanbus

This will yield the device (ex. 1,0,0)

Record a Data CD From the ISO Image

cdrecord -v -eject speed=2 dev=ATA:1,0,0 filename.iso

Notice we used the same device identifier that we found in the previous command.

Erase a Re-Writeable CD

cdrecord -v -eject speed=2 dev=ATA:1,0,0 blank=fast (or use blank=all, takes longer, more thorough)

Not all CD drives support re-writeable discs.

Mounting a Windows Share on a Linux System

smbmount //windowsserver/sharedfolder /local/path -o username=windowsusername,workgroup=activedirectorydomain

Or, with password:

smbmount //windowsserver/sharedfolder /local/path -o username=windowsusername,password=windowspassword,
    workgroup=activedirectorydomain

Creating a Swap File Under Linux

First, create an empty file, in this case 1500 MB:

dd if=/dev/zero of=/swapfile.1 bs=1024 count=1536000

Turn the file into a swap file:

mkswap /swapfile.1

Add the swap file to /etc/fstab:

/swapfile.1 none swap pri=5,defaults 0 0

Reboot, then show the active swap file:

swapon -s

We ran into trouble with this swap file when we tried to upgrade from Fedora Core 4 to Core 5.

Split Large Files

split –verbose -b 1024m filename.tar filename.

There is a dot at the end of that last command.

Put them back together with this:

cat filename.* > filename.tar

Windows

Recently we needed to move a large amount of data, on the order of 2 terabytes, from one Windows 2003 server to another over a wide area network. We originally planned on using RoboCopy, from the Windows Resource Kit, but decided against it. RoboCopy doesn’t copy NTFS permissions. Instead we chose xcopy.

We ran this command against each logical drive on the source machine, copying the files to matching drives on the target machine:

xcopy \sourced$ \targetd$ /D /E /V /C /F /G /H /K /O /X /Y >> \targetutilscopyfiles.log

The /D option, with no date specified, allowed us to run the copy over night during off-peak periods, interrupt it when needed, and then resume when we again had available bandwidth.

The logical drives, eight of them in all, each contained a number of shared folders. We recreated the shares on the target machine with commands like this:

net share marketing=”d:marketing” /remark:”Marketing Files Ð Owner: John Doe”

Security on the shared folders was controlled by NTFS permissions, copied from the source to the target with the /O option on the xcopy command-line. However, share-level permissions on shared folders are set by default to give everyone read-only access. Since the more restrictive settings override the less restrictive ones, this would mean users would have read-only access even if the NTFS permissions gave them edit rights. We corrected this by using permcopy to copy the everyone=full permissions from the shared folders on the source machine to the shared folders on the target machine.

permcopy \source marketing \target marketing

Note that we are not missing a from the command above. Permcopy doesn’t use UNC path names.