Category Archives: mount

Fstab – Manual Mounting and Udev Auto

Modern Linux distributions use udev which automount partitions to the system. This is most notably seen with usb device that are the predominant hot swappable media. Internal hard drives, particularly drives that are used to boot the system, have their mount points defined in the fstab file. Fstab is automatically generated during the Debian/Ubuntu installation process. Occasionally you’ll want to add entries such as to automount samba shares or if you have Windows partitions on the hard drive; although Windows partitions will most likely be handled automatically by udev. You can mount iso images automatically using fstab; but this may be unnecessarily permanent, and a temporary mount -t iso9660 cd.iso might simply be easier and more convenient.

Archivemount – Mount Zip, Rar, Tar, and Bz2 Archives

Hate unzipping an archive to view, or add files? Why not just mount the entire package and edit it like a regular folder. Archivemount does exactly this. On Ubuntu install the dependencies to build the binary. You need fuse, and its development package, and you need libarchive and its dev package. I forget the exact names of the files but use:

sudo apt-cache search fuse

I think the dev package for fuse is libfuse-dev. Then do the same for libarchive, which I think the dev package is libfuse-dev. With the dependencies satisfied download archivemount:

There is a pending request for a package to be added to the Ubuntu repositories, but everything works fine, and is rather straight forward when installing from source. Unzip the package, configure it, make it, and install it. It will now be a binary with a global path. The installer even adds a convenient nautilus script integrated into the right click drop down menu. Just right click on a compressed package and select archivemount. It will show up on your Ubuntu desktop just like a mounted partition or drive. Unmount by right clicking the mounted directory and selecting, you guessed it, unmount. Now zip up anything that you want to save space. Depending on the files you can save a small amount of space or a lot. With small text files, and source code you will save a fair amount, but with images and videos you will save less. You can probably zip your entire home directory and mount it on login. I’ll take a look at that when I have some time.

This is an interesting way to deal with file compression without compressing the entire filesystem.

Spin Down USB Hdd – Ehh I don’t Think Its Working

Oh, given my previously elabored backup configuations I have one further thing I would like to do. Since backup 1, and 2 are only used once per day I would like to spin down the hard drivers to increase longevity. I figured dismounting the drive would be effective, but I have encountered several things. First, usb drives are auto mounted, therefore there is no entry in fstab, and no folder in /media. If you dismount backup1:

sudo umount /media/backup1

Now just before issuing the backup rsync I would like to mount the hdd and spinup the hard drives:

sudo mount /dev/sdg1 /media/backup1

But the platters still feel like they are spinning. There is a hum to the disk, and it remains warm as if the partition was still mounted. Maybe I’m confused as to what a spindown is? I would like the hdd to be pseudo disconnected, even the the cable is connected, and then pseudo connected when data transmission is required just before the backup routine.

Tweaking Ubuntu – MythTV HDTV Recording

MythTV records HD tv from cable boxes via firewire. I have the Explorer 4250HD from Scientific Atlantic. The service is provided by Optimum, which is subsequently a service of Cablevision. I have connected a firewire cable from the output port on the cable box to the 1394 input port on my motherboard. With Ubuntu 1394 drivers are automatically installed, and MythTV is in the default Ubuntu repositories. To install MythTV use: sudo apt-get install mythtv This will completely install MythTV in working order. I like a theme called Me-Po. You can download it here: Unzip the folder and copy it to: /usr/share/mythtv/themes Select it in the appearance settings menu. Select it in the OSD settings menu as well, which is located in the playback menu. Now open the MythTV backend.

MythTV backend settings menu
MythTV backend settings menu
I am recording right now so I don’t want to kill the backend to get screenshots. Simply add the input device as your firewire. It should be P2P. Set for the 4250HD Scientific Atlantic select the 4200HD and the speed to 400. You will neeeeeeeed a schedules direct account!. Grab one for 20$ a year. There is no reason not to have it. Go through the rest of the menus, and where it asks you for your schedules direct username and password pop it in. Update your lineup, then associated your input device (firewire) with the schedules direct listings source. Grab listings to set the start channel. Then your gonna want a second hard drive for your HD recordings being that they are over 10 gigs a pop for a good one. Pirates of the Caribbean at Worlds End was like 12 Gigs. You configure where to save your recording in the directories menu. Obviously you will have to connect your HD, format it and mount it. Use gparted for this, nice and easy: sudo apt-get install gparted Mount the drive somewhere in /media. Once done press escape to exit the backend config. You be prompted to update your listings using mythfilldatabase. Ohh, and to launch MythTV automatically on boot create a script. Create a new empty file, call it Put in it: #!/bin/bash mythfrontend Then add it to the startup applications.
Startup configurations menu
Startup configurations menu
Mark the applications as executable. Add another startup script, after installing wmctrl: sudo apt-get install wmctrl In the script have: wmctrl -r "mythfrontend.real" -e 0,1921,0,1920,1080 -r is the window name. -e says where to put the window. In compiz there are viewport rather than workspaces. If you have a 1920×1080 desktop, with two viewports, then the second viewport starts at 1921. The code above will place MythTV on the second viewport autoamtically. Add the script to the startup applications list. Heres another post covering the same material. I don’t know what else to say here, but feel welcome to post questions in the comments and I’ll help the best I can.

Mount Temp Direcories as Devices

Mounting your temp directories as devices will store the data in your computers ram instead of on the filesystem. This will reduce the writes made to your storage device, which is  benificial for flash based systems. You can achieve this by adding various directories to your fstab (/etc/fstab) configuration file: tmpfs      /var/log/apt    tmpfs        defaults           0    0 tmpfs      /var/log        tmpfs        defaults           0    0 tmpfs      /tmp            tmpfs        defaults           0    0 tmpfs      /var/tmp        tmpfs        defaults           0    0