$ /sbin/fdisk -lu disk.img
You must set cylinders.
You can do this from the extra functions menu.
Disk disk.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
disk.imgp1 * 63 96389 48163+ 83 Linux
disk.imgp2 96390 2056319 979965 82 Linux swap / Solaris
disk.imgp3 2056320 78140159 38041920 5 Extended
disk.imgp5 2056383 3052349 497983+ 83 Linux
disk.imgp6 3052413 10859939 3903763+ 83 Linux
disk.imgp7 10860003 68372639 28756318+ 83 Linux
disk.imgp8 68372703 76180229 3903763+ 83 Linux
disk.imgp9 76180293 78140159 979933+ 83 Linux
The first few lines is fdisk complaining not being able to extract the
number of cylinders, since it has to operate on a file which does not provide
an ioctl interface.
The first important data are the units, which are stated to be 512 bytes per
sector. We take note of this value as the factor for use in the next
operation.
Let's say we want to access the 7th partition, which is 10860003 sectors into
the disk, according to the fdisk output. We know that each sector is 512
bytes, so:
10860003 * 512 = 5560321536Passing this number to losetup produces the desired result:
# losetup /dev/loop0 disk.img -o $((10860003 * 512)) # file -s /dev/loop0 /dev/loop0: Linux rev 1.0 ext3 filesystem data # mount /dev/loop0 /mnt [...] # umount /mnt # losetup -d /dev/loop0If the partition really holds a normal filesystem, you can also let mount set up the loop device, and manage it automatically:
# mount -o loop,offset=$((10860003 * 512)) disk.img /mnt [...] # umount /mntAnd since there's aparently no means to automate the whole process for an entire disk, I hacked up plosetup. Enjoy:
# plosetup lapse.hda . I: partition 1 of lapse.hda will become ./lapse.hda_p1 (/dev/loop0)... I: plosetup: skipping partition 2 of type 82... I: plosetup: skipping partition 3 of type 5... I: partition 5 of lapse.hda will become ./lapse.hda_p5 (/dev/loop1)... I: partition 6 of lapse.hda will become ./lapse.hda_p6 (/dev/loop2)... I: partition 7 of lapse.hda will become ./lapse.hda_p7 (/dev/loop3)... I: partition 8 of lapse.hda will become ./lapse.hda_p8 (/dev/loop4)... I: partition 9 of lapse.hda will become ./lapse.hda_p9 (/dev/loop5)... # ls -l total 0 lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p1 -> /dev/loop0 lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p5 -> /dev/loop1 lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p6 -> /dev/loop2 lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p7 -> /dev/loop3 lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p8 -> /dev/loop4 lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p9 -> /dev/loop5 # plosetup -c . # ls -l total 0(this post is dedicated to Penny for no other reason than the tunes I am listening to right now) NP: Fly My Pretties / The Return of Fly My Pretties Update: Be careful about the $((...)) style arithmetic. dash manages to overflow at 32bit. zsh and bash seem to get it right. If in doubt, use perl or a calculator.
sync-mirrors. No arguments, just the command. I pushed the button,
and we are now live.
#!/usr/bin/perl use Asterisk::AGI; use IO::Socket; # Set this to the broadcast address for your network $netbroadcast = "172.16.0.255"; $AGI = new Asterisk::AGI; my %input = $AGI->ReadParse(); my $num = $input 'callerid' ; my $name = $input 'calleridname' ; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); $date = sprintf("%02d/%02d/%4d %d:%02d:%02d",$mday,$mon+1,$year+1900,$hour,$min,$sec); $sock = IO::Socket::INET->new(PeerPort => 6948, PeerAddr => $netbroadcast, Proto => udp, Broadcast => 1 ) or die "Can't bind : $@\n"; print $sock <<EOT; <?xml version="1.0"?> <mythnotify version="1"><container name="notify_cid_info"><textarea name="notify_cid_line"><value>Unused</value></textarea><textarea name="notify_cid_name"><value>NAME: $name</value></textarea><textarea name="notify_cid_num"><value>NUM : $num</value></textarea><textarea name="notify_cid_dt"><value>$date</value></textarea></container></mythnotify> EOT close $sock; exit(0);That was accomplished by just adding an AGI(mythcid.agi) application call to one my existing extensions that handled incoming calls. Future enhancements will involve displaying who the caller wants to speak to after they've selected the appropriate response from the menu we give most callers. The Asterisk::AGI Perl module was a bit hard to track down. I've made a 2 second (dh-make-perl) Debian package of it, available here. If I get sufficiently motivated, I'll consider cleaning it up and uploading it to Debian.
--- Xorg.0.log.not-connected 2006-10-19 14:49:07.000000000 +0200 +++ Xorg.0.log.connected 2006-10-19 14:49:51.000000000 +0200 @@ -11,7 +11,7 @@ Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. -(==) Log file: "/var/log/Xorg.0.log", Time: Thu Oct 19 14:42:00 2006 +(==) Log file: "/var/log/Xorg.0.log", Time: Thu Oct 19 14:42:46 2006 (++) Using config file: "xorg.conf" (==) ServerLayout "Default Layout" (**) -->Screen "Default Screen" (0) @@ -444,7 +444,7 @@ (II) NV(0): Probing for analog device on output A... (--) NV(0): ...can't find one (II) NV(0): Probing for analog device on output B... -(--) NV(0): ...can't find one +(--) NV(0): ...found one (II) NV(0): Probing for EDID on I2C bus A... (II) NV(0): I2C device "DDC:ddc2" registered at address 0xA0. (II) NV(0): I2C device "DDC:ddc2" removed. @@ -452,7 +452,46 @@ (II) NV(0): Probing for EDID on I2C bus B... (II) NV(0): I2C device "DDC:ddc2" registered at address 0xA0. (II) NV(0): I2C device "DDC:ddc2" removed. -(II) NV(0): ... none found +(--) NV(0): DDC detected a CRT: +(II) NV(0): Manufacturer: MAX Model: 178e Serial#: 2006 +(II) NV(0): Year: 2000 Week: 13 +(II) NV(0): EDID Version: 1.0 +(II) NV(0): Analog Display Input, Input Voltage Level: 0.714/0.286 V +(II) NV(0): Sync: Separate +(II) NV(0): Max H-Image Size [cm]: horiz.: 36 vert.: 27 +(II) NV(0): Gamma: 2.76 +(II) NV(0): DPMS capabilities: StandBy Suspend Off; RGB/Color Display +(II) NV(0): redX: 0.632 redY: 0.329 greenX: 0.272 greenY: 0.604 +(II) NV(0): blueX: 0.142 blueY: 0.062 whiteX: 0.280 whiteY: 0.311 +(II) NV(0): Supported VESA Video Modes: +(II) NV(0): 640x480@60Hz +(II) NV(0): 640x480@75Hz +(II) NV(0): 800x600@75Hz [...more data about the monitor goes here...]The nv(4) manpage also contains this bit:
Option "CrtcNumber" "integer"
Many graphics cards with NVIDIA chips have two video outputs.
The driver attempts to autodetect which one the monitor is con
nected to. In the case that autodetection picks the wrong one,
this option may be used to force usage of a particular output.
The options are "0" or "1". Default: autodetected.
... but when I set that to 1 in the Section "Device" of my xorg.conf,
it still uses the internal monitor of my laptop. Am I missing
something?
I feel a little stupid for my last post about my unstable machine. It was the hardware to blame and my hard drive finally crashed during a Linux conference in Mendoza, Argentina. Typical.
At the conference there wasn´t much new for me and I regret that I didn´t get organised enough to give a talk about the Web and WHATWG stuff. Though I did manage to meet good people and talk about some topics that are of interest to me. As usual the fabulous friendly CafeLUG geeks from Buenos Aires were there, led by the wonderful DD Marcela. I also met an inspiring guy from Cordoba who founded a successful software company that works with free software. His brother gave a great talk about it at the conference. I really love to see Free software power people to start a business.
Oh and about my thinkpad X40 hard drive replacement. With the help of another new friend Fredrico from Mendoza, we called up IBM in Buenos Aires and arranged a new hard drive and a battery within 5 days! I didn´t know if my machine was under warranty still, phew. Unfortunately IBM called the next day saying they didn´t have any stock and the wait from the US is about 2 weeks. Since I have no idea where I will be in two weeks (ok, probably Sao Paulo, Brazil) I cancelled that request and now I have found a free Windoze (hopefully not trojaned) terminal just over the Andes, in Santiago Chile.
Tough life!
I feel a little stupid for my last post about my unstable machine. It was the hardware to blame and my hard drive finally crashed during a Linux conference in Mendoza, Argentina. Typical.
At the conference there wasn’t much new for me and I regret that I didn’t get organised enough to give a talk about the Web and WHATWG stuff. Though I did manage to meet good people and talk about some topics that are of interest to me. As usual the fabulous friendly CafeLUG geeks from Buenos Aires were there, led by the wonderful DD Marcela. I also met an inspiring guy from Cordoba who founded a successful software company that works with free software. His brother gave a great talk about it at the conference. I really love to see Free software power people to start a business.
Oh and about my thinkpad X40 hard drive replacement. With the help of another new friend from Mendoza, we called up IBM in Buenos Aires and arranged a new hard drive and a battery within 5 days! I didn’t know if my machine was under warranty still, phew. Unfortunately IBM called the next day saying they didn’t have any stock and the wait from the US is about 2 weeks. Since I have no idea where I will be in two weeks (ok, probably Sao Paulo, Brazil) I cancelled that request and now I have found a free Windoze (hopefully not trojaned) terminal just over the Andes, in Santiago Chile.
Tough life!
Please help broadcast our message across the nation: Sign our "This
November, I'm Voting My Values" pledge:
http://action.aclu.org/site/R?i=5dopkpJQPaNbn4A_kyuMzA..
To do that we must make civil liberties one of the top issues as
people head to the polls next month. Sign our "This November, I'm
Voting My Values" pledge.
http://action.aclu.org/site/R?i=ByYHnSn7ZbByadWPVPRB0X..
Jan-Marek and Florian talked us through their setup. They're using
FAI to automate
installation of systems, along with LDAP to store
lots of configuration information and GOsa as a user-friendly front-end
to that configuration. They've integrated these to enable some very
clever management features so that all aspects of the city-wide system
can be maintained from one central point. As new machines are
introduced onto the network, they can be configured into one class or
another: simple desktop clients up to so-called "depot" servers, used
as seeds for further clients. Individual user profiles can be tweaked,
giving users access to new applications as they are needed. Shared
resources like network storage and printers are set up automatically
from the LDAP database. Access to USB storage devices can be
controlled on a per-device, per-user basis for security.
That's quite an impressive feature list. Most of the work has been
in configuration and systems work rather than custom packages on the
clients themselves - the vast majority of the packages installed come
straight from the standard Debian archive, with some backports (like a
newer version of KDE). Building on top of standard packages means that
they have access to a huge amount of Free Software without having to
do all of the work themselves. A small team (10-ish at the moment,
growing to 100 or so in the future) can effectively deploy and manage
desktops and associated servers for a huge number of
users - they're expecting to be supporting on the order of 30,000
systems 2 years from now.
The team have just recently made their first stable release and are
starting to roll it out across the city, one department at a
time. There are the familiar issues involved in the deployment, of
course. For example, users don't want to help test pre-release
versions to help nail bugs, but then complain loudly when they find
bugs in the first release. And in such a large project to migrate from
predominantly Windows (NT4!) desktops to KDE on Linux, a major part of
the effort needed is in user training. There is quite a bit of support
and custom work needed to convert people's MS Office macros over to
working on top of OpenOffice. And there are still quite a number of
users who will remain using Windows for specific applications that
still don't have Linux equivalents yet. Apparently the "Wine Cellar"
group will help on that front. *grin*
In terms of collaborating with Debian, the LiMux team are expecting
to help in a few ways. As bug reports are filed against their
applications (apparently very few so far), they'll be pushed upstream
along with (hopefully) fixes for them. They will also be devoting some
full-time developer effort to security work; it would be good for both
sides if this effort can be shared.
It was quite striking to see Tux, the Linux penguin, as a visible
logo in local government offices! The team have clearly made some
excellent progress on this exciting project, and I'm sure that I can
speak for all of Debian in wishing them the best of luck in the
future. I'll be watching with interest...
Next.