How to write zeros to a drive
March 4th, 2007to zero hda, simply
dd if=/dev/zero of=/dev/hda bs=1M
to zero hda, simply
dd if=/dev/zero of=/dev/hda bs=1M
# sudo ln -s /etc/init.d/cupsys /etc/init.d/lpd
# sudo ln -s /etc/init.d/cupsys /etc/init.d/lprng
# sudo mkdir /var/spool/lpd
# sudo mkdir /var/spool/lpd/MFC9700
# sudo dpkg -i ~/Desktop/mfc9700lpr-*.i386.deb
# sudo ln -s /etc/init.d/cupsys /etc/init.d/cups
#sudo dpkg -i /home/gandalf/Desktop/cupswrapperMFC9700-*.i386.deb
e.g. Assumed that /dev/cdrom is the location of CD/DVD-ROM
sudo hdparm -d1 /dev/cdrom
sudo cp /etc/hdparm.conf /etc/hdparm.conf_backup
gksudo gedit /etc/hdparm.conf
* Append the following lines at the end of file
/dev/cdrom {
dma = on
}
* Save the edited file
This link worked wonders. *Be sure to enable the extra repositories
Software RAID in linux is turning out to be a big headache. dmraid is kicking my butt, and mdadm seems to be useful, but I haven’t fully figured it out yet. Who knew setting up a RAID array like this would be such a pain in the neck.
I got some info from this page.
I used the following command
# mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/hde1 /dev/hdf1
Which produced the following results
mdadm: size set to 244198464K
mdadm: array /dev/md0 started.
Which looks promising.
To stop the mdm array, I should use this:
# mdadm -S /dev/md0
The guide also recommends creating an /etc/mdadm.conf file.
After further investigation and experimentation, mdadm is definitely the way to go when creating software raid arrays. All other tools are outdated, and weren’t even available in apt-get or synaptic except for dmraid, which is horrible.
Part of the reason I had a hard time understanding everything with RAID and LVM and what not is because it was not clear to me how physical disks, partitions, LogicalGroups, LogicalVolumes, and arrays related to each other. This article got me headed down the right path.
First, it’s important to understand that software RAID arrays are made up of disk partitions, which are created on physical disks. I’m not sure if it matters what format the partitions are in if you’re using mdadm, but I left mine unformatted when creating them using gparted. After the array is created as /dev/md0 (or something similar) it can be formatted (in this case in xfs format using mkfs.xfs in the terminal).
LVM is somewhat similar, but has more hierarchy. LogicalVolumeGroups are composed of one or more disk partitions. Each LogicalVolumeGroup has zero or more LogicalVolumes (though a LVG isn’t useful without an LV), which can span multiple partitions (physical volumes). Just like RAID arrays, LogicalVolumes can be formatted via mkfs once they’ve been created. They can be found at /dev/_LVG_/_LV_ (where _LVG_ is your LogicalVolumeGroup name and _LV_ is the name of the LogicalVolume you which to mount).
Once the LVM and/or RAID is created, formatted, and ready to role, /etc/fstab has to modified to make sure the volumes are mounted at startup. This is pretty straightforward and can be decifered via the man pages, but this article has some good counsel
Great HowTo on the Ubuntu Forums as to how to get the FC5 LVM management GUI to work in Ubuntu 6.06.
Continuing with the server configuration and XBMC integration, ccXStream is a streaming server that utilizes XBMSP (Xbox Media Player Streaming Protocol). After getting my Ubuntu server installed and running, I thought I should use ccXStream because it is said to be slightly faster than crusing SMB shares.
The gzip of ccXStream linux source code was obtained from here (sourceforge link). I downloaded it to my desktop and expanded the archive to a folder on the desktop as well.
According to a linux guru friend, the best place to keep the files is /usr/local/sbin. He said that if I ever have questions about the directory hierachy, I should check out the manual pages by typing man hier in the console. Pretty self-explanatory, but worth writing down for posterity.
Because the archive contains source code, not .deb or .rpm or any other form of ready-made packages, I had to compile it myself. Unfortunately, Ubuntu doesn’t come with gcc or make (yeah, crazy!), but them easily using Synaptic to download and install the build-essential package. This gave me what I needed to compile ccXStream.
So after installing the build-essential package, I used the console and navigated to the directory containing the ccXStream source code. Then, I used the command gksudo make. After entering the password, lots of warning showed up, but no errors, which meant the code compiled and created two executables: ccxstream and ccxtest.
ccxstream is the XBMSP server itself, which listens on port 1400
ccxtest is a small client program that attempts to connect to localhost:1400
More on running ccxstream coming soon, once I figure out how to schedule it to run at startup…
After experiencing other PVR software packages including Windows XP Media Center Edition, SnapStream Beyond TV, MediaPortal, and even MythTV, I decided to switch to Xbox Media Center and a home media server.
Fortunately, I had the majority of the components for building a home media server just lying around. I only needed a better motherboard and some hard drive coolers. Here’s what I put together:
This server covers a variety of purposes utilizing the following software:
Recently I’ve taken the initiative to SoftMod my v1.4 Xbox so that I could run Xbox Media Center (XBMC) on it, instead of using a media center PC in my living room. There’s just one problem with needing a network-connected Xbox in my living room: as of yet my house is not wired with Cat5e, and an ethernet port is the only network connection the Xbox supports. Fortunately, I do have a D-Link DI-624 wireless G router, but how to get the Xbox to connect wirelessly?
Here’s where D-Link’s DWL-G820 Wireless Gaming Adapter comes into the picture. The G820 is essentially a wireless bridge, meaning it can connect one wired portion of the network to another wired portion of the network via a wireless connection. Thus, the Xbox can connect to the G820, which connect it to the network.
Why the G820 and not something else? Well, I have a 3rd generation DI-624 D-Link wireless router, which happens to support “Super G” technology — up to 108 Mbps if connecting to compatible hardware. The DWL-G820 is “Super G” compatible. Because XBMC will be streaming music, pictures, and especially video from a network share, 11Mbps 802.11b simply will not get the job done. 54Mbps with 802.11g would probably suffice, but I thought that just to be safe (and since I already had the D-Link router) I ought to go with 108 Mbps 802.11 “Super G”. Unfortunately, since the 802.11n standard won’t be released until 2007, any implementation of 108 Mbps is vendor-specific, thus I needed a D-Link product to achieve that speed.
I purchased my G820 off eBay, taking it off the hands of someone who “couldn’t get it working.” It was a bit risky seeing that the item could actually have been malfunctioning, but I was willing to gamble that like most wireless product, the configuration was just a little bit above the average Joe’s understanding.
Indeed, configuration of the G820 was extremely convoluted. I spent at least two hours plugging the thing directly into my router and attempting to connect to it from a PC also connected to that router. I tried resetting it, thinking the previous owner may have used a custom IP address. I tried using the static IP on my PC as D-Link’s directions stated. I even tried disabling all the security on my wireless network hoping I could crawl before I walked. It all failed. I ended up calling D-Link tech support, and running through the same steps I’d just tried, hoping they might have an idea what I was doing wrong. Their conclusion — I had a faulty unit.
But I wasn’t ready to give up hope. I went digging around in my bag of cables and found an ethernet cross-over cable (meant to connect two PC’s directly together without a hub between them). Connecting the game adapter to the router via the cross-over cable didn’t yield any results, but when I connected the adapter to the PC via the cross-over cable, I noticed the status lights behaving differently. It was then that I assigned a static IP to my PC and was able to access the adapter’s configuration menu.
So in short, here’s what you have to do to get access to the DWL-G820’s configuration webpage:
1. Use an ethernet cross-over cable to connect the adapter to your PC
2. Change your computer’s TCP/IP settings to use a static IP of 192.168.0.51 and subnet mask 255.255.255.0 (disregard gateway and DNS info)
3. Use a web browser to navigate to 192.168.0.35
4. Login with username “admin” and no password
5. Configure the adapter as necessary for your wireless router/AP
But hold on, you’re not done yet. D-Link made another major mistake in the manufacture of this product. The case for the adapter is very poorly designed and facilitates frequent overheating of the adapter, which means it locks up. In the first week of use I had to restart the adapter and Xbox every time I sat down to use XBMC. It was extremely frustrating and inconvenient. In researching the problem I found countless others on the net that experience the same lock-ups, but no solution to the problem. I was again about ready to call D-Link again when I decided that maybe I could get the thing to cool off by modifying the case and possibly adding a chipset cooler.
The hardest thing about this idea was getting the case apart. It took a great deal of effort. The case can only be opened by unplugging the AC adapter and ethernet cable from the unit and removing the antenna. Once that is done, hold the unit in your strong hand such that your thumb is positioned on the seam infront of the rear “end cap” on one side of the adapter, and your index or middle finger is positioned in the corresponding spot on the other side of the adapter. Pince the case hard while using your other hand to pull on the darker colored rear “end cap”. Hopefully the cap will come off. The same procedure can be used to free the front “end cap”. Once that is done the top should come off the case.
After getting the case apart, I didn’t have time to go buy a chipset cooler, so I just left the top off and reassembled the rest of the case. Fortunately, that was enough to prevent the adapter from overheating and locking up. I’ve haven’t had to restart the DWL-G820 for over a week now! I have to admit, though, that I don’t like having all the electronics completely exposed to my living room. I am planning to modify the case by drilling holes into the top of it to facilitate better cooling.
I hope this helps anyone who has experienced similar difficulties. Please feel free to email me at “matthew” at this_domain_name_and_suffix if you have any questions.