tag:blogger.com,1999:blog-56170195377701404712024-02-20T21:22:45.224-05:00darkphader's ramblingsthe computer guy muses about tech, bikes, food, whatever...Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-5617019537770140471.post-79994491197435186602017-07-10T12:48:00.000-04:002017-07-10T12:48:41.142-04:00Notes on migrating / upgrading Samba PDC to AD<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notes on upgrading/migrating a Samba 3 PDC to a Samba 4 AD on a totally separate system.</span></div>
<b id="docs-internal-guid-495ee18e-2d65-5af2-b705-d20d90634f16" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Scenario (in my case):</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Running an older Samba 3 release with a tdbsam backend as a PDC, file and print server on an older distro that cannot be (easily, if at all) upgraded.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">A need to move to Active Directory technology.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Will use best practices - keeping the AD server separate from the file and printer server.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The new AD will be on a new server with a different hostname and IP address. The old PDC will remain running until the new AD is in place and tested.</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Most info for doing this is detailed in the link below:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://wiki.samba.org/index.php/Migrating_a_Samba_NT4_Domain_to_Samba_AD_(Classic_Upgrade)" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Migrating a Samba NT4 Domain to Samba AD (Classic Upgrade)</span></a></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Some gotchas are detailed in:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://wiki.samba.org/index.php/Migrating_a_Samba_NT4_Domain_to_Samba_AD_(Classic_Upgrade)#Avoiding_common_problems" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Avoiding common problems</span></a></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Another gotcha that I ran into was that my old PDC was using a local Windows built-in group (</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Print Operators</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> in this case), and such mapped groups will cause the </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">classicupgrade</span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> process to fail.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">What isn’t immediately realized (or wasn’t by me) is that if you just take a brand new Samba install on a brand new server and attempt the </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">classicupgrade </span><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">process as detailed above there will be problems. The reason is that Samba PDC databases do not contain all of the information necessary to do the upgrade. The users, machines, and groups all exist in ‘nix land and are necessary to that environment.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Even though the new AD (again operating as just an AD) itself does not need the ‘nix equivalent users and groups for proper operation, the upgrade process does.</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It is necessary to create the same users (including machines) and groups on the new “virgin” box. It is not necessary to match UID’s of the users or machines but the GID’s of the groups must match, and the users need to added to the groups they are members of.</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Once the upgrade is complete and the AD is up and running the added ‘nix users and groups can be removed.</span></div>
Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com0tag:blogger.com,1999:blog-5617019537770140471.post-82933065341264067482015-08-03T15:22:00.001-04:002015-08-03T15:22:23.992-04:00Fedora install issue - The system may not be bootable.If you see this error message when installing Fedora (was version 22 in my case):<br />
<div>
<br />
<div>
<b>There was an error installing the bootloader. The system may not be bootable.</b><br />
<div>
<br /></div>
<div>
Remind yourself that the system <b><i>may</i></b> be bootable!<br />
<br />
The first 5 times I elected to stop the install (why continue if the system wont boot?). But the sixth time around after doing everything I could to verify it should be working I elected to go ahead with the install even though "The system may not be bootable.".<br />
<br />
Guess what happened?<br />
<br />
It didn't boot.<br />
<br />
But the only reason it didn't boot was because the system was set to boot in BIOS mode and not in UEFI mode that I used when booting the install stick. Apparently the installer was unable to change the system's default boot selection. I went into the system setup and changed the default boot device to UEFI mode and the proper drive, booted again, and it all worked perfectly.<br />
<br />
Possibly if the default boot setup had previously been set as such I may have never seen that message.<br />
<br />
<br /></div>
</div>
</div>
Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com0tag:blogger.com,1999:blog-5617019537770140471.post-61704003489075760302013-06-06T10:37:00.000-04:002013-06-06T10:41:18.081-04:00Fix error 0x000006d1 using level 3 print drivers from Samba to Windows 8Ran across error <span style="background-color: white;">0x000006d1 when attempting to add Samba shared printers to Windows 8 systems. The following fixed the issue for me. </span>This may also help for earlier versions of Windows but I've only run across the problem with some (not all) Windows 8 systems.<br />
<br />
<a name='more'></a><br />
<br />
Basically add (or edit) the following key in the registry:<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers]<br />
"ForceCSREMFDespooling"=dword:00000000<br />
<br />
Then reboot (restarting the print spooler is probably enough but it's easier to have a client reboot the system)Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com1tag:blogger.com,1999:blog-5617019537770140471.post-21529091828065737802012-09-18T13:34:00.001-04:002012-09-18T13:34:19.195-04:00nVidia with Ubuntu - no X or low graphics mode<h2>
After updates and a reboot, Ubuntu 12.04(.1) reports low graphics mode and/or X does not start when using the nVidia driver.</h2>
I've seen this problem on two systems recently and it appears to be a timing issue in that the nVidia driver does get loaded but apparently not in time for X to find a valid screen.<br />
<br />
Workaround is simple: add <b>nvidia</b> to the file <b>/etc/modules </b>it will then get loaded on boot and X will start normally.Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com0tag:blogger.com,1999:blog-5617019537770140471.post-75652350363559614012012-05-28T20:16:00.001-04:002012-07-08T11:33:42.709-04:00EFI Stub - booting without a bootloaderIn this post I'm detailing a quick and easy method to use EFI Stub boot introduced in the Linux kernel version 3.3.0 that provides for a faster boot without the use of a bootloader (such as grub) on a UEFI capable system.<br />
<a name='more'></a>The steps are what I did using my Gentoo installation which means I needed to customize my kernel to support this process. You may find that this step isn't necessary with some other modern distros.<br />
<br />
We need to configure the kernel with the following:<br />
<br />
<span style="color: blue;">CONFIG_EFI=y</span><br />
<span style="color: blue;">CONFIG_RELOCATABLE=y</span><br />
<span style="color: blue;">CONFIG_FB_EFI=y</span><br />
<span style="color: blue;">CONFIG_FRAMEBUFFER_CONSOLE=y</span><br />
<span style="color: blue;">CONFIG_EFI_PARTITION=y</span><br />
<span style="color: blue;">CONFIG_EFI_VARS=m</span><br />
<span style="color: blue;">CONFIG_EFI_STUB=y</span><br />
<br />
Also it simplifies to add any kernel command-line parameters that you pass with your current bootloader to the "Built-in kernel command line". Mine are:<br />
<span style="color: blue;">CONFIG_CMDLINE="root=/dev/sda6"</span><br />
<br />
Also note that I don't use an initramfs, if you do you might check here for some hints: <a href="https://bbs.archlinux.org/viewtopic.php?pid=1090040" rel="nofollow" target="_blank">archlinux post 1090040</a>.<br />
<br />
<br />
Recompile and install the updated kernel. I also suggest testing the built-in parameters. In my case I just made another grub entry leaving off the "root=" entry to make sure I could still properly boot:<br />
<br />
<span style="color: #134f5c;">title=Gentoo Sources 3.4.0-gentoo built-in</span><br />
<span style="color: #134f5c;">root (hd0,0)</span><br />
<span style="color: #134f5c;">kernel /boot/kernel-3.4.0-gentoo</span><br />
<span style="color: #134f5c;"><br /></span><br />
<span style="color: #134f5c;">title=Gentoo Sources 3.4.0-gentoo</span><br />
<span style="color: #134f5c;">root (hd0,0)</span><br />
<span style="color: #134f5c;">kernel /boot/kernel-3.4.0-gentoo root=/dev/sda6</span><br />
<div>
<br /></div>
<div>
We're still booting with our bootloader but we now know the kernel command line we embedded is working fine.</div>
<div>
<br /></div>
<div>
We need the <span style="color: #274e13;">efibootmgr</span> package installed if it isn't already. Check and do this now if necessary.</div>
<div>
<br /></div>
<div>
It's like this: "The first rule of Fight Club...", unless we boot using UEFI we cannot instruct our UEFI BIOS to do so from our hard drive. Here we make our own boot medium so this this can be accomplished. If you already have such media you can use it and skip ahead. The cool thing here is that you'll be booting into your system using your kernel, just not from the hard drive via UEFI yet.<br />
<br />
Prepare a USB stick with a small (you'll need room for your kernel, any initramfs, and the efi shell if desired) FAT32 partition, type <span style="color: #660000;">EF00</span> (GPT - I used gdisk) or <span style="color: #660000;">ef</span> (MBR). Mount this new partition, we'll use sde2 as the example and /mnt/temp as a temporary mount point (use whatever you normally do). Also I'm specifically using data from my own 64 bit Gentoo install - make the proper translations for your particular system:</div>
<div>
<span style="color: purple;">mount /dev/sde2 /mnt/temp</span></div>
<div>
<span style="color: purple;">cd /mnt/temp</span></div>
<div>
<span style="color: purple;">mkdir -p efi/boot</span></div>
<div>
<span style="color: purple;">cd efi/boot</span></div>
<div>
<span style="color: purple;">cp /boot/kernel-3.4.0-gentoo bootx64.efi</span></div>
<div>
<span style="color: purple;"><br /></span></div>
<div>
Now we reboot, go into our UEFI BIOS and tell it to boot from using UEFI mode from our USB stick.</div>
<div>
<br /></div>
<div>
Wow, that was easy. We booted without a bootloader!</div>
<div>
<br /></div>
<div>
Now we need to get the same results from our hard drive. The same type/format partition is necessary, so either find space or make space, however you choose, for a FAT32 partition of type EF00/ef. In my case it was /dev/sda8:</div>
<div>
<span style="color: purple;">mount /dev/sda8 /mnt/temp</span></div>
<div>
<div>
<span style="color: purple;">cd /mnt/temp</span></div>
<div>
<span style="color: purple;">mkdir -p efi/gentoo</span></div>
</div>
<div>
<div>
<span style="color: purple;">cd efi/gentoo</span></div>
<div>
<span style="color: purple;">cp /boot/kernel-3.4.0-gentoo gs340x64.efi</span></div>
</div>
<div>
<span style="color: purple;"><br /></span></div>
<div>
Now we have our kernel in a place the UEFI BIOS can see it.</div>
<div>
<br /></div>
<div>
It's time to instruct the UEFI BIOS to boot from the Kernel Stub on our hard drive (note that we must have booted via UEFI mode for the following to work - which is one reason we went through the USB stick step):</div>
<div>
<span style="color: purple;">modprobe efivars</span></div>
<div>
<span style="color: purple;">efibootmgr --create --part 8 --label "Gentoo-3.4.0" --loader '\efi\gentoo\gs340x64.efi</span></div>
<div>
<span style="color: purple;"><br /></span></div>
<div>
<span style="color: red;"><b>Be careful </b></span>- <span style="color: #274e13;">efibootmgr</span> defaults to <span style="color: #274e13;">/dev/sda</span> which works fine in my case but see "<span style="color: #741b47;">man efibootmgr</span>" for details before continuing.</div>
<div>
<br /></div>
<div>
Shut down your system,. remove the USB stick, and enjoy fast booting without a bootloader!<br />
<br />
To learn more about EFI booting see: <a href="http://www.rodsbooks.com/efi-bootloaders/" rel="nofollow" target="_blank">Rod Smith's page.</a></div>
<div>
<br /></div>
<div>
<br /></div>
<br />Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com4tag:blogger.com,1999:blog-5617019537770140471.post-56209294037293753282012-03-02T18:39:00.000-05:002012-03-03T00:43:51.308-05:00no bootable device - gpt<span style="font-size: large;">Some legacy BIOS's may have an issue with a GPT partitioned drive.</span><br />
<span style="font-size: large;"><br /></span><br />
Ran across this recently with an Intel D975XBX board. I GPT partitioned a drive with gdisk, installed Ubuntu and when I rebooted after the install completed with surprised to see "No Bootable Device..." displayed.<br />
<br />
<a name='more'></a><br />
<br />
The fix is this case was to mark the partition bootable using fdisk - it seems that the BIOS will complain as above unless it sees such a partition.<br />
<br />
In this case wasn't large enough to mandate using GPT, it was just a preference.<br />
<br />
================================================<br />
# gdisk /dev/sda<br />
<br />
GPT fdisk (gdisk) version 0.8.1<br />
<br />
Partition table scan:<br />
MBR: protective<br />
BSD: not present<br />
APM: not present<br />
GPT: present<br />
<br />
Found valid GPT with protective MBR; using GPT.<br />
<br />
Command (? for help): p<br />
Disk /dev/sda: 625142448 sectors, 298.1 GiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): A3664325-EFDC-458D-96E9-059556C452EB<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 625142414<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 1574911 768.0 MiB 8300 Linux filesystem<br />
2 1574912 9963519 4.0 GiB 8200 Linux swap<br />
3 9963520 72878079 30.0 GiB 0700 Linux filesystem<br />
4 72878080 625142414 263.3 GiB 0700 Linux filesystem<br />
<div>
================================================</div>
<div>
<br /></div>
<div>
Fdisk will surely complain as it doesn't support GPT partitioned drives:</div>
<div>
<div>
================================================</div>
</div>
<div>
<br />
# fdisk /dev/sda<br />
<br />
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.<br />
<br />
Command (m for help): p<br />
<br />
<br />
Disk /dev/sda: 320.1 GB, 320072933376 bytes<br />
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0x00000000<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 1 625142447 312571223+ ee GPT<br />
<div>
================================================</div>
<br /></div>
<div>
<div>
And notice that in this case it only shows 1 partition.<br />
However if we go ahead and enable the boot flag:<br />
================================================<br />
<br />
Command (m for help): a<br />
Partition number (1-4): 1<br />
Command (m for help): w<br />
================================================</div>
</div>
<div>
All is fine and even though the gdisk output will not look any different the system will boot.<br />
<br />
Note that I made this change this after the system was already installed (booted from the same systemrescuecd flash drive that I used to partition the drive) - there was no need to reinstall.</div>Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com1tag:blogger.com,1999:blog-5617019537770140471.post-36097715805204786442011-10-27T19:00:00.002-04:002013-06-06T14:04:07.975-04:00CUPS Samba 64bit automatic driver download<span style="font-family: Arial, Helvetica, sans-serif;">The same ease of using Samba hosting for automatic download of the CUPS/Windows Postscript drivers for 32 bit clients can be implemented for 64 bit clients as well.</span><br />
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<a name='more'></a></div>
<div>
<span style="background-color: transparent; font-family: Arial, Helvetica, sans-serif;"><i>Brief overview of stuff you already need to know how to do:</i></span></div>
<div>
<ol>
<li><span style="background-color: transparent; font-family: Arial, Helvetica, sans-serif;">Your printer needs to be added to CUPS</span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent;">generally consists of placing proper PPD files - many available at <a href="http://cups.org/ppd.php">http://cups.org/ppd.php</a> - in </span>/usr/share/cups/model/ and following the CUPS documentation.</span></li>
</ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Set Samba up properly for CUPS</span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">See: <a href="http://samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html">http://samba.org/samba/docs/man/Samba-HOWTO-Collection/CUPS-printing.html</a></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Samba usually needs to be reloaded after adding printers to CUPS</span></li>
</ul>
</ol>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>OK, let's dive in and do it.</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: blue;">We need the drivers.</span> Some from CUPS, some from your Windows system.</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent;">The 32 bit CUPS drivers are available from: </span><a href="http://svn.easysw.com/public/windows/trunk/i386/" style="background-color: transparent;">http://svn.easysw.com/public/windows/trunk/i386/</a></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">The 64 bit CUPS drivers are available from: <a href="http://svn.easysw.com/public/windows/trunk/x64/" style="background-color: transparent;">http://svn.easysw.com/public/windows/trunk/x64/</a></span><br />
<br />
EDIT: the above links to the CUPS drivers are now dead. A sad day for Linux printing when Apple bought EasySW.<br />
<ol><ul>
</ul>
</ol>
</div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">The Windows drivers are on the client systems. We need these files:</span></div>
<div>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">ps5ui.dll</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">pscript.hlp</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">pscript.ntf</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">pscript5.dll</span></li>
</ul>
<span style="font-family: Arial, Helvetica, sans-serif;">Extract the 32 bit ones from (a 32 bit system):</span></div>
<div>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">\Windows\System32\spool\drivers\W32X86\PCC\ntprint.inf_<random-stuff>.cab</span></li>
</ul>
<span style="font-family: Arial, Helvetica, sans-serif;">Extract the 64 bit ones from (a 64 bit system):</span></div>
<div>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">\Windows\System32\spool\drivers\x64\PCC\ntprint.inf_<random-stuff>.cab</span></li>
</ul>
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;">Prepare the drivers that we have downloaded.</span></div>
<div>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">They all need to be lower case! You may need to rename the ones from the Windows clients.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">The <span style="color: red;">64 bit<b><i> </i>cups6.inf</b> file is not properly "decorated"</span> - see: <a href="http://support.microsoft.com/kb/888728">http://support.microsoft.com/kb/888728</a> we need to fix this:</span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><a href="http://realcomputerguy.com/files/cups6.inf.x64.patch">http://realcomputerguy.com/files/cups6.inf.x64.patch</a> makes it simple.</span></li>
</ul>
</ul>
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;">Prepare/populate the directories.</span></div>
<div>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">The 32 bit drivers that we have obtained and prepared need to be copied to:</span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">/usr/share/cups/drivers/</span></li>
</ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">The 64 bit drivers that we have obtained and prepared need to be copied to:</span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">/usr/share/cups/drivers/x64/</span></li>
</ul>
<li><span style="background-color: transparent; font-family: Arial, Helvetica, sans-serif;">Due to cupsaddsmb quirk (lower case "x"), check and "fix", if necessary, the Samba x64 directory:</span></li>
<ul>
<li><span style="background-color: transparent; font-family: Arial, Helvetica, sans-serif;">ls /var/lib/samba/printers/</span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">if your distro/installation created an X64 (upper case) instead of an x64 directory symlink to it:</span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">cd /var/lib/samba/printers</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">ln -s X64 x64</span></li>
</ul>
</ul>
</ul>
</ul>
<span style="color: blue; font-family: Arial, Helvetica, sans-serif;">Add the printer drivers to Samba.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Now we use <b>cupsaddsmb</b>, which handles all the rpcclient calls, to add the printers to our Samba installation. Simplest is:</span></div>
<div>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">cupsaddsmb -v -a</span></li>
</ul>
<span style="font-family: Arial, Helvetica, sans-serif;">Read "man cupsaddsmb" for more options.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com7tag:blogger.com,1999:blog-5617019537770140471.post-42287227862373238932011-04-17T11:30:00.001-04:002011-04-17T13:57:52.287-04:00NT4 inaccessible_boot_deviceI recently needed to boot a cloned image of an old <b>NT4</b> system under a <b>virtual machine</b>. Of course, nothing is easy sometimes. In this case I was using VirtualBox as between it and Qemu(KVM) it seemed to have the best support for <b>NT4</b>. However it didn't emulate the Adaptec SCSI hardware that the original system used and boot attempts were met by the famous <b>BSOD</b> with <b>inaccessible_boot_device</b>. Loading up a new <b>VM</b> with <b>NT4</b> and booting with <b>/sos</b> (selecting VGA mode is one way) to see what drivers were being loaded the difference was that the new install loaded <b>ATAPI.SYS</b> and the cloned image was loading <b>AIC78xx.SYS</b>, which gave me an idea.
I booted the cloned image from a <b>SystemRescueCD</b> mounted the "<b>C:</b>" drive with <b>ntfs-3g</b> and copied the <b>ATAPI.SYS</b> driver over the <b>AIC78xx.SYS</b> driver as <b>AIC78xx.SYS</b> and voila, the system now boots!
Not claiming this will work in every case but it did work in this one.Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com0tag:blogger.com,1999:blog-5617019537770140471.post-72133562098165832432010-12-10T00:43:00.004-05:002013-04-09T14:14:20.585-04:00Samba and guest shares with "security = user"<h3>
How to have a guest share on Samba without resorting to the deprecated "security = share" configuration.</h3>
This is a regular query on the Samba mailing list. When it comes to "security = share" just say no!<br />
<a name='more'></a><b>In a nutshell you need:</b><br />
<ul>
<li>A username map file.</li>
<li>A valid 'nix "guest" user mapped to the Windows guest account ("nobody" in most distros).</li>
<li>Proper smb.conf configuration.</li>
</ul>
In this example our username map file is /etc/samba/smbusers. It maps a 'nix user to a Windows user.<br />
<b>In smbusers:</b><br />
nobody = guest<br />
<b>In smb.conf:</b><br />
[global]<br />
...<br />
security = user<br />
Map to guest = Bad User<br />
username map = /etc/samba/smbusers<br />
...<br />
-- no 'valid users =' line -- (<i>means don't use a "valid user = " entry</i>)<br />
<br />
[theshare]<br />
...<br />
guest ok = yes<br />
-- no 'valid users =' line --<br />
...<br />
Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com13tag:blogger.com,1999:blog-5617019537770140471.post-11112138141671991322010-11-12T12:33:00.004-05:002010-11-12T13:57:51.138-05:00Practice safe and secure SSH !Some tips to consider when using SSH.<br />
<br />
Probably the most ubiquitous piece of software in use is <a href="http://openssh.org/">OpenSSH</a>.
It is from the developers that also bring us that most secure OS, <a href="http://openbsd.org/">OpenBSD</a>. We all use it, we all love it, we all depend on it.
Please donate to these great projects if you can! And read on for the tips...<br />
<a name='more'></a><br />
<ol>
<li>Use an alternate port.</li>
<ul>
<li>This is more of an annoyance issue. Port 22 is a prime target for bots trying to gain entry into a system
as it soon becomes clear when examining the logs on a publicly facing host. Sure, the firewall can block access based
on repeated attempts but I find it simpler just to listen on a different port. Example sshd_config entry:</li>
<li>Port 12345</li>
</ul>
<li>Don't allow the username "root" access.</li>
<ul>
<li>The one easily guessable username that will always be attempted by crackers is "root".
Disallow this access. The sshd_config entry:</li>
<li>PermitRootLogin no</li>
</ul>
<li>Use Protocol 2 only.</li>
<ul>
<li>Protocol 1 is considered weak and insecure. Protocol 2 is now the default on current implementations. The sshd_config entry:</li>
<li>Protocol 2</li>
</ul>
<li>Limit logins by username.</li>
<ul>
<li>Besides blocking root access we can also limit logins to specific user names.
If you're not on this list you don't get a chance.
If root access to the host is needed be sure that the proper users are in the wheel group. Example sshd_config entry:</li>
<li>AllowUsers lexluther loislane</li>
</ul>
<li>Use public-key-encryption.</li>
<ul>
<li>By using public-key encryption with a strong passphrase and denying password authentication your host is very safe.
Many sites have instructions for setting this up and duplication here is unnecessary.
Set up and test your public-key access before you turn off password authentication. The sshd_config entries:</li>
<li>PubkeyAuthentication yes</li>
<li>PasswordAuthentication no</li>
</ul>
<li>Use the "Match" feature to add more flexibility.</li>
<ul>
<li>Your host is now safe from the public side but you need access from various systems internally and conclude that
password access is fine in this case as all of the other safeguards are still in place.
In this case we'll use "Match" to override our "PasswordAuthentication no" directive when we connect from our
internal network. Example sshd_config entry:</li>
<li>Match Address 192.168.0.*<br />
PasswordAuthentication yes</li>
</ul>
<li>Make it easy to use public-key encryption with <a href="http://www.funtoo.org/en/security/keychain/intro/">Keychain</a>.
Virtually every modern distro has this packaged and available.</li>
<li>Make it easy to access your hosts on alternate ports with some edits to the ssh_config file.</li>
<ul>
<li>Your /etc/ssh/ssh_config file will have a default entry for host connections. Something like:</li>
<li>Host *<br />
AddressFamily inet<br />
Port 22<br />
Protocol 2<br />
PreferredAuthentications publickey,keyboard-interactive,password
</li>
<li>Simply add an entry above it for hosts that you want to treat differently. Example:</li>
<li>Host host1 host 2 host3 host4<br />
AddressFamily inet<br />
Port 12345<br />
Protocol 2<br />
User lexluther<br />
PreferredAuthentications publickey,keyboard-interactive,password</li>
</ul>
</ol>Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com2tag:blogger.com,1999:blog-5617019537770140471.post-44245018240013502182010-09-13T14:40:00.016-04:002011-04-10T18:26:21.623-04:00Add bootable DOS support to your USB stick<span class="Apple-style-span" style="font-family: inherit;">Building on the <a href="http://blog.realcomputerguy.com/2010/08/add-systemrescuecd-capability-to-your.html">previous post</a> where we added <a href="http://www.sysresccd.org/">SystemRescueCD</a> capabilities to our USB stick </span>(please see that post for details and conventions that pertain to this one as well) while still being able to use it for transferring files between various OS, we will now add bootable DOS support so that we can use it for BIOS updates as well as other DOS based tools such as Intel's SSD firmware updater.<br />
<a name='more'></a><br />
I was frustrated by other methods I found when researching. One needed my whole USB stick, which was undesirable and another using a pre-built image with no control over the config.sys, etc. left me in a pseudo floppy mode (A:\ drive) and also crashed on a regular basis. There had to be a better way. I wanted the whole nine yards - one USB stick for system rescue, BIOS/firmware upgrades, and file transfer between Windows and 'nix systems. A veritable digital swiss army knife! This way you get full control over the config.sys and autoexec.bat files. New embedded systems without floppy and CD/DVD drives really helped make the case for solving this issue without purchasing new hardware to drag around.<br />
<br />
<span class="Apple-style-span" style="font-family: inherit;"></span>This post will have less hand-holding than the previous one. Hopefully the detail provided previously will get you through this post without problems.<br />
<br />
<span class="Apple-style-span" style="font-family: inherit;">For enhanced flexibility we'll use a separate "/boot" partition. This will allow for easily updating the SystemRescueCD and other partitions with new/updated data without disturbing the installed GRUB files.</span><br />
<br />
<span class="Apple-style-span" style="font-family: inherit;">We'll need two more products: </span><a href="http://www.freedos.org/freedos/files/"><span class="Apple-style-span" style="font-family: inherit;">FreeDOS</span></a><span class="Apple-style-span" style="font-family: inherit;"> (download the fdfullcd.iso) and install </span><a href="http://advancemame.sourceforge.net/boot-download.html"><span class="Apple-style-span" style="font-family: inherit;">makebootfat</span></a><span class="Apple-style-span" style="font-family: inherit;"> (your distro most likely has this packaged).</span><br />
<br />
Create a working directory for the necessary FreeDOS files and loop mount the FreeDOS iso.<br />
<span class="Apple-style-span" style="font-family: inherit;">Example:</span><br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;">mkdir <i>fdwrk</i></span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">mkdir <i>fdboot</i></span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">mount -o loop <i>/path/to/fdfullcd.iso /mnt/loop</i></span></li>
</ul><div>Copy (as a minimum) the files:</div><ul><li><span class="Apple-style-span" style="font-family: inherit;">kernel.sys</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">himem.exe</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">command.com</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">more.exe</span></li>
</ul><span class="Apple-style-span" style="font-family: inherit;"> from <i>/mnt/loop</i>/freedos/setup/odin to your <i>fdwrk</i> directory.</span><br />
<br />
Create or copy a config.sys file (necessary to load the command interpreter) to your <i>fdwrk</i> directory:<br />
Example config.sys file:<br />
===============================================<br />
DEVICE=HIMEM.EXE<br />
LASTDRIVE=Z<br />
<div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-family: inherit;">BUFFERS=20 </span></span></div><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-family: inherit;">FILES=40</span></span></div><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-family: inherit;">DOS=HIGH,UMB</span></span></div><div style="margin: 0px;"><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-family: inherit;">DOSDATA=UMB</span></span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-family: inherit;">SHELLHIGH=command.com /P</span></span></div></div><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-family: inherit;">===============================================</span></span><br />
<br />
Create or copy an autoexec.bat file (the simple one below will avoid the date/time prompt) to your <i>fdwrk</i> directory:</div><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;">Example autoexec.bat file:</span></div><div style="margin: 0px;"><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;">===============================================</span></div></div><div style="margin: 0px;"><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;">CLS</span></div></div><div><div style="margin: 0px;"><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;">===============================================</span></div></div></div><div></div><div></div><br />
Make sure your config.sys and batch files use DOS/Windows line termination - CR+LF and not just LF as is standard with 'nix systems.<br />
<div><br />
</div><span class="Apple-style-span" style="font-family: inherit;">Copy the file:</span><br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;"> /source/ukernel/boot/fat16.bin</span></li>
</ul><span class="Apple-style-span" style="font-family: inherit;"> from inside the <i>/mnt/loop</i>/freedos/packages/src_base/kernels.zip file to the <i>fdboot</i> directory.</span><br />
<br />
<span class="Apple-style-span" style="font-family: inherit;">Instead of just two partitions as in the previous post we will make 4. Basically the same instructions but partitions 2 & 3 can be pretty small. I made them both 128M which really is overkill but I don't need the space that bad. I used:</span><br />
<ol><li><span class="Apple-style-span" style="font-family: inherit;">6500M type "c" FAT32LBA (for file sharing - must be first partition, sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">1/hd</span><i><span class="Apple-style-span" style="font-family: inherit;">4</span></i><span class="Apple-style-span" style="font-family: inherit;">,0)</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">128M type "e" FAT16 (the DOS partition, sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">2/hd</span><i><span class="Apple-style-span" style="font-family: inherit;">4</span></i><span class="Apple-style-span" style="font-family: inherit;">,1)</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">128M type "83" Linux (the /boot partition - where grub resides, sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">3/hd<i>4</i></span><i><span class="Apple-style-span" style="font-family: inherit;"></span></i><span class="Apple-style-span" style="font-family: inherit;">,2)</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">800M (or remaining space) type "83" Linux (the SystemRescueCd partition, sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">4/hd</span><i><span class="Apple-style-span" style="font-family: inherit;">4</span></i><span class="Apple-style-span" style="font-family: inherit;">,3)</span></li>
</ol><span class="Apple-style-span" style="font-family: inherit;">Format partition 1 as previously, format partitions 3 & 4 as we did partition 2 previously. Format partition 2 as fat16:</span><br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;">mkfs.vfat -F16 /dev/sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">2</span></li>
</ul><span class="Apple-style-span" style="font-family: inherit;">Mount the linux partitions on available mountpoints:</span><br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;">mount -t ext4 /dev/sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">3 <i>/media/usbstickgrub</i></span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">mount -t ext4 /dev/sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">4 <i>/media/usbsticksysrescue</i></span></li>
</ul><span class="Apple-style-span" style="font-family: inherit;">Copy the SystemRescueCD files to <i>/media/usbsticksysrescue</i>:</span><br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;">cp -a <i>/where.your.System.RescueCD.files.are/</i>* <i>/media/usbsticksysrescue/</i>*</span></li>
</ul><span class="Apple-style-span" style="font-family: inherit;"></span><span class="Apple-style-span"> </span><br />
<span class="Apple-style-span" style="font-family: inherit;">Prepare <i>/media/usbstickgrub</i>:</span><br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;">mkdir -p <i>/media/usbstickgrub</i>/boot/grub</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">cp -a /lib/grub/<i><distro-specific></i>/* <i>/media/usbstickgrub</i>/boot/grub</span></li>
</ul><span class="Apple-style-span">Add the FreeDOS entry to the grub's menu.lst file we created in the previous post (</span><span class="Apple-style-span"><i>/media/usbstickgrub</i>/boot/grub/menu.lst)</span><span class="Apple-style-span">:</span><br />
<span class="Apple-style-span">===============================================</span><br />
<span class="Apple-style-span" style="line-height: 20px;"><span class="Apple-style-span">timeout 10<br />
<br />
title SystemRescueCD 32bit<br />
kernel (hd0,3)/isolinux/rescuecd<br />
initrd (hd0,3)/isolinux/initram.igz<br />
<br />
title SystemRescueCD 64bit<br />
kernel (hd0,3)/isolinux/rescue64</span></span><br />
<span class="Apple-style-span" style="line-height: 20px;"><span class="Apple-style-span">initrd (hd0,3)/isolinux/initram.igz</span></span><br />
<br />
<span class="Apple-style-span">title FreeDOS</span><br />
<span class="Apple-style-span">rootnoverify (hd0,1)</span><br />
<span class="Apple-style-span">makeactive</span><br />
<span class="Apple-style-span">chainloader +1</span><br />
<span class="Apple-style-span">===============================================</span><br />
<br />
Install grub:<br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;">grub</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;"> grub> find /boot/grub/menu.lst (will help identify the root partition) </span></li>
<li><span class="Apple-style-span" style="font-family: inherit;"> grub> root (hd</span><i><span class="Apple-style-span" style="font-family: inherit;">4</span></i><span class="Apple-style-span" style="font-family: inherit;">,2) (specify our new /boot partition)</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;"> grub> setup (hd</span><i><span class="Apple-style-span" style="font-family: inherit;">4</span></i><span class="Apple-style-span" style="font-family: inherit;">) (install GRUB in the USB stick's MBR)</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;"> grub> quit</span></li>
</ul><span class="Apple-style-span" style="font-family: inherit;">Prepare our bootable DOS partition:</span><br />
<ul><li><span class="Apple-style-span" style="font-family: inherit;">makebootfat -P -o /dev/sd</span><i><span class="Apple-style-span" style="font-family: inherit;">e</span></i><span class="Apple-style-span" style="font-family: inherit;">2 -b <i>/path/to/fdboot</i>/fat16.bin <i>/path/to</i>/fdwrk</span></li>
</ul><span class="Apple-style-span" style="font-family: inherit;">When this is complete you can mount the DOS partition and add any other files you want. You could have also placed these in fdwrk and they would have been added by the makebootfat process.</span><br />
<div><br />
<div><div><div style="margin: 0px;"></div></div><div><div style="margin: 0px;"><span class="Apple-style-span" style="font-family: inherit;">The nice thing about this method is that when booting into DOS the partition is seen as the </span><b><span class="Apple-style-span" style="color: purple;"><span class="Apple-style-span" style="font-family: inherit;">C:</span></span></b><span class="Apple-style-span" style="font-family: inherit;"> drive, however, many BIOS/firmware upgrade batch (and config.sys) files may assume you're booting from a floppy and have some hardcoded </span><b><span class="Apple-style-span" style="color: purple;"><span class="Apple-style-span" style="font-family: inherit;">A:\</span></span></b><span class="Apple-style-span" style="font-family: inherit;"> paths. Simply edit these files as needed and remove the </span><b><span class="Apple-style-span" style="color: purple;"><span class="Apple-style-span" style="font-family: inherit;">A:\.</span></span></b></div></div><div></div><div><br />
<span class="Apple-style-span" style="font-family: inherit;">The FreeDOS partition may have to exist under some limit (8GB, 16GB ?). As my USB stick is only 8GB I didn't run into any issues. If you have a larger USB stick you may not have success if your FreeDOS (2nd) partition is beyond such limit.</span><br />
<br />
<span class="Apple-style-span" style="font-family: inherit;">Please comment on whether you find this information useful or what might be done to improve it. Thank you! </span></div></div></div>Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com8tag:blogger.com,1999:blog-5617019537770140471.post-24932823189651257992010-08-31T12:39:00.005-04:002010-10-04T15:53:30.220-04:00Add SystemRescueCD capability to your USB stickFor Linux users: Creating a bootable <a href="http://www.sysresccd.org/">SystemRescueCD</a> USB stick. The SystemRescueCD is an invaluable resource and should be in every techs toolkit. Kudos and much thanks to the developers!<br />
<a name='more'></a><br />
This is a modified version of section D) at:<br />
<a href="http://goo.gl/EXw1">How to install SystemRescueCd on a USB stick</a><br />
Please see this page for other details.<br />
<br />
Also <b><span class="Apple-style-span" style="color: #990000;">this assumes grub and not grub2</span></b> is in use on your system. You most likely will have to modify for a grub2 install. One big difference is that partition numbers in grub2 are "1" based and not "0" based as they are in grub.<br />
<br />
One reason for this additional material is that the grub-install method did not work at all for me, I needed to manually run grub. The other is that I wanted most of the USB stick to be usable for transferring files between various devices/OS's - the common file system for such purposes is FAT32.<br />
<br />
Unlike Linux, Windows, myopic as it is, can only see the first partition on a USB stick (out of the box). And for added safety I wanted the SystemRescuCD code to reside on a non-Windows usable file-system, in this case ext4. So we make the first partition FAT32, for portability, and the second partition, which Windows doesn't see anyway, ext4.<br />
<br />
<div style="color: red;">WARNING - running these commands will destroy data - be absolutely sure you are working with the proper device!</div><br />
When you see "sd<i>e</i>", substitute the "<i>e</i>" with the drive letter of your target device, do not blindly type it in as is. When you see hd<i>4</i> substitute the "<i>4</i>" with the corresponding 0 based number as <i>e</i> is to <i>4 </i>(notes below). In my actual system, with 4 hard drives (sda, sdb, sdc, sdd), the flash drive is sde and grub's syntax refers to it as hd4.<br />
<br />
Become root or use sudo, whatever your style is.<br />
<br />
Prepare (erase) the flash drive by writing all "ones" (not zeroes) to it:<br />
<ul><li>tr '\000' '\377' < /dev/zero | dd bs=16384 of=/dev/sd<i>e</i></li>
</ul>* The "erased state" for flash is when it is filled with all 1's. People regularly make the mistake of filling flash based storage devices with all zeros (as is typically done with real disks) without every realizing what they are doing. See: <a href="http://goo.gl/FHMx">Bootable Installation From USB Flash Sticks</a><br />
<br />
Write a new blank partition table (if your distro's fdisk doesn't turn DOS compatibility mode off, turn it off as well - the "c" command):<br />
<ul><li>fdisk -H 224 -S 56 /dev/sd<i>e</i></li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>o</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>w</li>
</ul>Create 2 new partions, a primary of type "c" (FAT32 LBA) for data sharing, sized to leave about 1.5GB remaining at end of drive, example is for an 8GB flash drive:<br />
<ul><li>fdisk -H 224 -S 56 /dev/sd<i>e</i></li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>n</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>p</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>1</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>(accept default)</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>+<i>6500</i>M (~capacity of your stick minus 1500M)</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>n</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>p</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>2</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>(accept default)</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>+800M</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>t</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>1</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>c</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>a</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>2</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>w</li>
</ul>The above will leave a bit of free space on the device (don't fret). The ending sequences: t,1, c - set's partition 1 to FAT32 LBA and a, 2 toggles the bootable flag for partition 2.<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
Make sure your OS sees the new partition layout:<br />
<ul><li>fdisk -l /dev/sd<i>e</i></li>
</ul>If not run "partprobe" or remove/reinsert the USB stick and try again.<br />
<br />
Format partition 1:<br />
<ul><li>mkfs.vfat /dev/sd<i>e</i>1</li>
</ul>Format partition 2 (disabling journal):<br />
<ul><li>mkfs.ext4 -O ^has_journal /dev/sd<i>e</i>2</li>
</ul>Check the file system integrity:<br />
<ul><li>fsck /dev/sd<i>e</i>1</li>
<li>fsck /dev/sd<i>e</i>2</li>
</ul>If above is fine then mount this /dev/sd<i>e</i>2 to <i>/media/usbstick</i> (as example - if your OS automounts you can use that mountpoint - but stay consistent) and copy the files from your SystemRescueCD into this directory. (cf normal instructions)<br />
<ul><li>mount -t ext4 /dev/sd<i>e</i>2 <i>/media/usbstick</i></li>
<li>cp -a <i>/where.your.System.RescueCD.files.are/</i>* <i>/media/usbstick/</i>*</li>
</ul>Copy GRUB staging files from an existing GRUB installation:<br />
<ul><li>mkdir -p <i>/media/usbstick/</i>boot/grub</li>
<li>cp -a /lib/grub/<i><distro-specific></i>/* <i>/media/usbstick/</i>boot/grub</li>
</ul>Create a menu.lst in <i>/media/usbstick/</i>boot/grub/. Note that we use hd0 here instead of hd<i>4</i> as grub will see the usb stick as hd0 when we boot from it.<br />
===============================================<br />
timeout 10<br />
<br />
title SystemRescueCD 32bit<br />
kernel (hd0,1)/isolinux/rescuecd<br />
initrd (hd0,1)/isolinux/initram.igz<br />
<br />
title SystemRescueCD 64bit<br />
kernel (hd0,1)/isolinux/rescue64<br />
initrd (hd0,1)/isolinux/initram.igz<br />
===============================================<br />
<br />
Original page recommends to run:<br />
<ul><li>grub-install --root-directory=<i>/media/usbstick/</i> /dev/sd<i>e</i></li>
<li>**(this did not work for me)</li>
</ul>Alternate to above "grub-install" (properly replace hd<i>4</i> with the correct data, see below):<br />
<ul><li>grub</li>
<li> grub> find /boot/grub/menu.lst (will verify the proper root location)</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>grub> root (hd<i>4</i>,1) (specify where your /boot partition resides)</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>grub> setup (hd<i>4</i>) (install GRUB in the USB stick's MBR)</li>
<li><span class="Apple-tab-span" style="white-space: pre;"> </span>grub> quit</li>
</ul>Grub's syntax is zero based, drive sda would be hd0, drive sdb would be hd1 and so on, therefore drive sd<i>e</i> is hd<i>4</i>. The same goes for partition numbering, the first partition is 0, the second is 1. Our SystemRescueCD data is on the 2nd partition of sd<i>e</i>, hence (hd<i>4</i>,1) in the example.<br />
<br />
You should now be able to boot into the SystemRescue OS as well as use the first partition for transferring files between various OS's.<br />
<br />
Please comment on whether you find this information useful or what might be done to improve it. Thank you!Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com10tag:blogger.com,1999:blog-5617019537770140471.post-90665323744754142272010-08-29T20:13:00.000-04:002010-10-04T15:18:15.397-04:00Ubuntu install hangs on partitioning @43%Many sites are recommending setting up the partition table on an SSD using:<br /><ul><li>fdisk -H 32 -S 32 /dev/sdx</li></ul>Unfortunately for a complex partitioning scheme this causes Ubuntu partman to hang during installation (at 43% in my case).<br /><br />I discovered that:<br /><ul><li>fdisk -H 224 -S 56 /dev/sdx</li></ul>Works just fine.Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com1tag:blogger.com,1999:blog-5617019537770140471.post-4583800762353342212010-08-28T16:42:00.004-04:002010-10-04T15:54:53.816-04:00Overview for installing Ubuntu via networkSimple overview for installing Ubuntu via network.<br />
<ul><li>Ubuntu Server is the OS we will install in this guide.</li>
<li>Note: this is just the big picture, other guides can instruct on setting up the various DHCP, DNS, TFTP, and HTTP servers.</li>
<li>The main idea is to focus on the fact that once the detail work is done (and most local networks have these setup) there's basically only 3 major steps to net install nirvana.</li>
</ul><a name='more'></a><br />
Why?<br />
<ul><li>Let's say you have a new energy efficient small, maybe 1U rack or smaller device with no CD reader. You don't want to spend the cash for an external CD(DVD)/R(W), you don't want to deal with the various USB guides, you already have a the following prereqs, or a device or two you can easily install and configure the services on.</li>
</ul>Prereqs:<br />
<ul><li>A PXE enabled NIC on the target device.</li>
<li>A capable DHCP server.</li>
<li>A TFTP server.</li>
<li>An HTTP server (FTP, NFS are also fine but not explored here).</li>
<li>The Ubuntu install ISO you wish to use - ubuntu-10.04.1-server-amd64.iso will be used in this example.</li>
</ul>Mount the ISO at the TFTP server root, and (re)start the TFTP server:<br />
<div style="font-size: x-large;"></div><div><ul><li>mount -o loop /path/to/ubuntu-10.04.1-server-amd64.iso /path/to/tftproot </li>
</ul>Mount the ISO at an HTTP host or vhost root (this assumes your TFTP and HTTP servers are on separate hosts - see notes below):</div><div><ul><li>mount -o loop /path/to/ubuntu-10.04.1-server-amd64.iso /path/to/www </li>
</ul>Edit your DHCP server to provide the proper data to the PXE client, by adding:</div><div><ul><li>filename "install/netboot/pxelinux.0";</li>
<li>next-server tftpserverhostname<your hostname="" s="" server="" tftp="">;</your></li>
</ul>Example:</div><div><ul><li> pool {</li>
<li> deny known-clients;</li>
<li> range 192.168.1.21 192.168.1.25;</li>
<li> filename "install/netboot/pxelinux.0";</li>
<li> next-server mytftpserver;</li>
<li> }</li>
</ul>Restart the DHCP server.</div><div><br />
</div><div>Enable PXE boot in your target device and boot. The installation will begin.</div><div><br />
</div><div>As you follow the installation you will be asked what mirror to use for the Ubuntu archive. Scroll to the top of the country list and select "enter information manually". When prompted type in the HTTP hostname that will serve up the previous mounted ISO's files, ex: www.mylocalsrv.soho. On the next screen leave /ubuntu/ as the archive mirror directory. Finish installation.</div><div><br />
</div><div>Notes:</div><div><ol><li>If your DHCP server and TFTP server are on the same host then the "next-server" DHCP entry may not be needed (I haven't tested this as these are different servers on my network).</li>
<li>If your TFTP and HTTP servers are on the same host then instead of two separate loop mounts you could symlink one to the other. Again not the case on my network (and of course I had a copy of the ISO on each system).</li>
<li>Without DNS resolution you will need to specify the TFTP "next-server" and your HTTP server using IP addresses instead of hostnames.</li>
</ol>Fini </div>Darkphaderhttp://www.blogger.com/profile/00522202035245685302noreply@blogger.com0