cp(1) fails to copy file from /proc

2009-04-15 Thread Jukka Salmi
Hello,

I'm not sure wheter this is a bug or a feature...  However, I just noticed
that cp(1) fails to copy /proc/cpuinfo to the file system (tested on i686 and
x86_64 lenny systems):

$ wc -l /proc/cpuinfo 200 /proc/cpuinfo
$ cp /proc/cpuinfo /tmp
$ echo $?
0
$ wc -l /tmp/cpuinfo
125 /tmp/cpuinfo

The first part of the file is copied correctly, but the rest is missing.
Running strace(1) on cp reveals that cp requests to read 4 kB, receives less
(but still 0), writes the received data to the destination file and exits:

$ strace cp /proc/cpuinfo /tmp
[...]
open(/proc/cpuinfo, O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
open(/tmp/cpuinfo, O_WRONLY|O_CREAT|O_EXCL, 0444) = 4
fstat(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, processor\t: 0\nvendor_id\t: Genuine..., 4096) = 3535
write(4, processor\t: 0\nvendor_id\t: Genuine..., 3535) = 3535
close(4)= 0
close(3)= 0
close(0)= 0
close(1)= 0
close(2)= 0
exit_group(0)   = ?

Subsequent read(2)s would have returned more data (and thus allowed cp to
successfully copy the file), as running strace on the the attached test
program shows:

$ strace ./a.out /proc/cpuinfo /tmp
[...]
open(/proc/cpuinfo, O_RDONLY) = 3
open(/tmp/cpuinfo, O_WRONLY|O_CREAT|O_EXCL, 0777) = 4
read(3, processor\t: 0\nvendor_id\t: Genuine..., 8192) = 3535
write(4, processor\t: 0\nvendor_id\t: Genuine..., 3535) = 3535
read(3, processor\t: 5\nvendor_id\t: Genuine..., 8192) = 2121
write(4, processor\t: 5\nvendor_id\t: Genuine..., 2121) = 2121
read(3, ..., 8192)= 0
exit_group(0)   = ?

What's the problem here?  Is this a bug in cp, in the proc file system, or is
cp simply not supposed to work on such file systems?


TIA, Jukka

-- 
This email fills a much-needed gap in the archives.
#include err.h
#include fcntl.h
#include unistd.h

int
main(int argc, char *argv[])
{
char buf[8*1024], *bufp;
int in, out;
int nread, nwritten, nleft;

if ((in = open(argv[1], O_RDONLY, 0)) == -1) {
err(1, open(src));
}
if ((out = open(argv[2], O_WRONLY|O_CREAT|O_EXCL, 0777)) == -1) {
err(1, open(dst));
}

while ((nread = read(in, buf, sizeof buf))  0) {
nleft = nread;
bufp = buf;
while (nleft  0) {
if ((nwritten = write(out, bufp, nleft)) == -1) {
err(1, write);
}
nleft -= nwritten;
bufp += nwritten;
}
}
if (nread == -1) {
err(1, read);
}

return 0;
}


Re: install daemon without starting it

2009-04-02 Thread Jukka Salmi
Sven Joachim -- debian-user (2009-04-01 18:07:34 +0200):
 On 2009-04-01 17:23 +0200, Jukka Salmi wrote:
 
  Hello,
 
  is it possible to install a daemon from a Debian package without having
  it automatically started afterwards?
 
 Temporarily create an executable /usr/sbin/policy-rc.d that exits with a
 value of 101, e.g. the following shell script:
 
 #!/bin/sh
 exit 101
 
 This tells invoke-rc.d to disable all actions, see
 /usr/share/doc/sysv-rc/README.invoke-rc.d.gz.
 
  What I want to do is to install samba, but neither smbd nor nbmd
  should be started until I had a chance to edit smb.conf(5) manually...
 
 Just don't forget to remove the policy-rc.d script afterwards.

Thanks, this seems to work fine.


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



install daemon without starting it

2009-04-01 Thread Jukka Salmi
Hello,

is it possible to install a daemon from a Debian package without having
it automatically started afterwards?

What I want to do is to install samba, but neither smbd nor nbmd
should be started until I had a chance to edit smb.conf(5) manually...


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: unbootable system after fresh 4.0r5 installation

2008-12-11 Thread Jukka Salmi
Boyd Stephen Smith Jr. -- debian-user (2008-12-08 16:46:46 -0600):
 http://reactivated.net/writing_udev_rules.html

Thanks, udev(7) is probably what I was looking for.

I tried two approaches:

  1) Using built-in persistent symlinks (/dev/disk/...).
  2) Writing custom rules to create symlinks to the desired file system
 block devices.

I then used those symlinks in /etc/fstab and /boot/grub/menu.lst

While 1) worked fine, I noticed a problem with 2): passing the symlink
to the root file system as the root= kernel option doesn't work (ALERT!
/dev/root doesn not exist...).  I guess this makes sense since my
custom rule which defines the root file system symlink is in a file on
the root file system (/etc/udev/rules.d/010_local.rules)...  But why
does 1) work then?  The symlinks I use (/dev/disk/by-id/scsi-XXX-partN)
seem to be defined in /etc/udev/persistent.rules, i.e. also on the root
file system:

KERNEL==sd*[!0-9]|dasd[!0-9]*|sr*,ENV{ID_SERIAL}==?*, \
SYMLINK+=disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}
KERNEL==sd*[0-9]|dasd*[0-9],  ENV{ID_SERIAL}==?*, \
SYMLINK+=disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n

Any hints?


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: unbootable system after fresh 4.0r5 installation

2008-12-11 Thread Jukka Salmi
Sven Joachim -- debian-user (2008-12-11 13:02:54 +0100):
 Have you rebuilt your initramfs?  Udev and the whole /etc/udev directory
 are copied into it, so you need to run update-initramfs -u to have
 these rules available at boot time.

Thanks a lot, that was exactly what I was missing (hmm, I should
probably start reading documentation first... ;-)).


Thanks again,

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



setting default package grouping mechanism in aptitude

2008-12-09 Thread Jukka Salmi
Hello,

I'd like the packages to be displayed sorted by status and then by
priority.  Hitting `G' and then changing the given

task,status,section(subdir,passthrough),section(topdir)

to

task,status,priority,section(subdir,passthrough),section(topdir)

seems to do what I want.  But I'd like this to be the default package
grouping mechanism and not to enter it every time I use aptitude.  Thus
I tried setting

Aptitude::UI::Default-Grouping
  { task,status,section(subdir,passthrough),section(topdir); };

in ~/.aptitude/config, but this doesn't seem to work: All files are
displayed at once, apparently sorted alphabetically, and hitting `G'
shows an empty grouping order.

What am I missing?

And, BTW, according to the documentation, the default for
Aptitude::UI::Default-Grouping is

filter(missing),status,section(subdir,passthrough),section(topdir)

but this is not what an initial `G' shows (see above, `filter(missing)'
vs `task').  Any hints?


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



setting themes in aptitude

2008-12-09 Thread Jukka Salmi
Hi,

on a recent 4.0r5 system I tried setting the aptitude theme but failed.
I added

Aptitude::Theme Dselect;

to ~/.aptitude/config, but aptitude simply didn't show _any_ package
anymore.  Same for the Vertical-Split theme.  Both themes _are_
defined in /usr/share/aptitude/aptitude-defaults, and that file _is_
read by aptitude.

What could be the problem here?


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: setting default package grouping mechanism in aptitude

2008-12-09 Thread Jukka Salmi
Daniel Burrows -- debian-user (2008-12-09 06:57:48 -0800):
 On Tue, Dec 09, 2008 at 03:29:09PM +0100, Jukka Salmi [EMAIL PROTECTED] was 
 heard to say:
[...]
  Aptitude::UI::Default-Grouping
{ task,status,section(subdir,passthrough),section(topdir); };
[...]
   You need to do this:
 
 Aptitude::UI::Default-Grouping
   task,status,section(subdir,passthrough),section(topdir);
 
   Curly braces introduce a new sub-group, so the config file fragment
 you wrote is the same as this:
 
 Aptitude::UI::Default-Grouping ;
 Aptitude::UI::Default-Grouping:: 
 task,status,section(subdir,passthrough),section(topdir);
 

Thanks, I missunderstood the syntax.


   You need to file a bug saying that the documentation didn't change
 the last time that the default did.

I'll do this as soon as reportbug is installed...


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: unbootable system after fresh 4.0r5 installation

2008-12-08 Thread Jukka Salmi
Jukka Salmi -- debian-user (2008-12-07 16:27:57 +0100):
 Hello,
 
 Sven Joachim -- debian-user (2008-12-05 17:54:56 +0100):
  On 2008-12-05 17:27 +0100, Jukka Salmi wrote:
  
   I just installed Debian 4.0r5 on a i386 systems (Dell PowerEdge 2950).
   While the installer seemed to have succeeded without problems, the
   freshly installed system didn't boot because its root file systems could
   not be found:
  
 Begin: Waiting for root file system... ...
 [...]
 sd 3:0:0:0: Attached scsi removable disk sdb
  
   At this point the system hanged for some minutes, until
  
 ALERT! /dev/sdb3 does not exist. Dropping to a shell!
  
   was output and the BusyBox shell was executed.
  
   But indeed there is no /dev/sdb; there's only one (logical) disk
   present, /dev/sda.
  
  How many physical discs does the system have (removable and
  non-removable)?
 
 The system has three SCSI disks, but since they are connected to a RAID
 controller to form a RAID 5 the OS should see just a single disk.
 
 BTW, I see the same problem on another i386 system (also a PowerEdge
 2950).  It has six SCSI disks, four of which form a RAID 1+0, and two a
 RAID 1.  The installer sees /dev/sd[abc], but after the system is
 installed the disk which was sdc became sdb, and the original sdb became
 sda.
 
 I should probably find out what sda is...  I can try this tomorrow.

The installer kernel prints (hand-typed):

[...]
  Vendor: Dell  Model: Virtual  CDROMRev: 123
  Type:   CD-ROM ANSI SCSI revision: 00
  Vendor: Dell  Model: Virtual  Floppy   Rev: 123
  Type:   Direct-Access  ANSI SCSI revision: 00
usb-storage: device scan complete
usb-storage: device scan complete
sr0: scsi-1 drive
sr 0:0:0:0: Attached scsi CD-ROM sr0
sr 0:0:0:0: Attached scsi generic sg0 type 5
scsi 1:0:0:0: Attached scsi generic sg1 type 0
sd 1:0:0:0: Attached scsi removable disk sda
floppy0: no floppy controllers found
[...]

Hmm, is sda this Virtual Floppy?  What's this?  And what's a Virtual
CDROM?  (There's an ATAPI CD-ROM connected to the system, but no floppy
drive.)

However, the real disk later (as soon as the installer menu detect
disks is selected) attaches as sdb:

[...]
scsi3 : LSI Logic SAS based MegaRAID driver
[...]
scsi 3:0:32:0: Attached scsi generic sg2 type 13
  Vendor: DELL  Model: PERC 6/i  Rev: 1.21
  Type:   Direct-Access  ANSI SCSI revision: 05
SCSI device sdb: 570949632 512-byte hdwr sectors (292326 MB)
[...]
sd 3:2:0:0: Attached scsi disk sdb
sd 3:2:0:0: Attached scsi generic sg3 type 0
[...]

What seems to be the problem is the order in which those devices attach.
After installation and the following restart, the new kernel boots as
follows:

[...]
scsi0 : LSI Logic SAS based MegaRAID driver
[...]
  Vendor: DELL  Model: PERC 6/i  Rev: 1.21
  Type:   Direct-Access  ANSI SCSI revision: 05
[...]
SCSI device sda: 570949632 512-byte hdwr sectors (292326 MB)
[...]
sd 0:2:0:0: Attached scsi disk sda
[...]
  Vendor: Dell  Model: Virtual  Floppy   Rev: 123 
  Type:   Direct-Access  ANSI SCSI revision: 00
  Vendor: Dell  Model: Virtual  CDROMRev: 123 
  Type:   CD-ROM ANSI SCSI revision: 00
usb-storage: device scan complete
sd 3:0:0:0: Attached scsi removable disk sdb
usb-storage: device scan complete
sr0: scsi-1 drive
sr 2:0:0:0: Attached scsi CD-ROM sr0
scsi 0:0:32:0: Attached scsi generic sg0 type 13
sd 0:2:0:0: Attached scsi generic sg1 type 0
sr 2:0:0:0: Attached scsi generic sg2 type 5
sd 3:0:0:0: Attached scsi generic sg3 type 0
floppy0: no floppy controllers found
[...]

Hmm, this is a little bit scary because I don't understand how the
kernel choses the order of attaching devices.  Can this be made static
somehow?  I.e. can I somehow configure the kernel to always recognise
the SCSI RAID controller as scsi0?


  the installed system?
 
 I don't remember which version they were exactly (something like
 2.6.18?), but calling uname(1) from an installer shell and from the
 installed system's shell both showed the same release version.

Installer kernel:
~ # uname -a
Linux (none) 2.6.18-6-486 #1 Sat Jan 26 08:50:43 UTC 2008 i686 unknown

Installed kernel:
debian:~# uname -a
Linux debian 2.6.18-6-686 #1 SMP Mon Oct 13 16:13:09 UTC 2008 i686 GNU/Linux


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: unbootable system after fresh 4.0r5 installation

2008-12-08 Thread Jukka Salmi
Chris Davies -- debian-user (2008-12-05 18:15:12 +):
 I've also come across this, and it seems only to affect DELL 2950s.
 I've not logged a bug because I couldn't work out /where/ (i.e. which
 package) I should log it against.
 
 You need to boot a Rescue CD [*] and change all occurrences of sdb to
 sda in the files /boot/grub/menu.lst and /etc/fstab. (At least, that's
 what my memory suggests as I don't have my notes to hand.)

Thanks for the hint.  I was able to fix the problem without a rescue CD:
Manually changing GRUBs root= parameter, booting to single-user and then
fixing fstab and menu.lst (and re-running update-grub(8)) seems to have
been enough.


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: unbootable system after fresh 4.0r5 installation

2008-12-07 Thread Jukka Salmi
Hello,

Sven Joachim -- debian-user (2008-12-05 17:54:56 +0100):
 On 2008-12-05 17:27 +0100, Jukka Salmi wrote:
 
  I just installed Debian 4.0r5 on a i386 systems (Dell PowerEdge 2950).
  While the installer seemed to have succeeded without problems, the
  freshly installed system didn't boot because its root file systems could
  not be found:
 
  Begin: Waiting for root file system... ...
  [...]
  sd 3:0:0:0: Attached scsi removable disk sdb
 
  At this point the system hanged for some minutes, until
 
  ALERT! /dev/sdb3 does not exist. Dropping to a shell!
 
  was output and the BusyBox shell was executed.
 
  But indeed there is no /dev/sdb; there's only one (logical) disk
  present, /dev/sda.
 
 How many physical discs does the system have (removable and
 non-removable)?

The system has three SCSI disks, but since they are connected to a RAID
controller to form a RAID 5 the OS should see just a single disk.

BTW, I see the same problem on another i386 system (also a PowerEdge
2950).  It has six SCSI disks, four of which form a RAID 1+0, and two a
RAID 1.  The installer sees /dev/sd[abc], but after the system is
installed the disk which was sdc became sdb, and the original sdb became
sda.

I should probably find out what sda is...  I can try this tomorrow.


 And do you know the kernel versions in the installer and
 the installed system?

I don't remember which version they were exactly (something like
2.6.18?), but calling uname(1) from an installer shell and from the
installed system's shell both showed the same release version.


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



unbootable system after fresh 4.0r5 installation

2008-12-05 Thread Jukka Salmi
Hello,

I just installed Debian 4.0r5 on a i386 systems (Dell PowerEdge 2950).
While the installer seemed to have succeeded without problems, the
freshly installed system didn't boot because its root file systems could
not be found:

Begin: Waiting for root file system... ...
[...]
sd 3:0:0:0: Attached scsi removable disk sdb

At this point the system hanged for some minutes, until

ALERT! /dev/sdb3 does not exist. Dropping to a shell!

was output and the BusyBox shell was executed.

But indeed there is no /dev/sdb; there's only one (logical) disk
present, /dev/sda.

While the installer was running I ran `fdisk -l /dev/sdb' and saw the
partitions I created.  (I don't know what the installer kernel thought
/dev/sda was.)  Reading /etc/fstab and /boot/grub/menu.lst after the
failed boot, it seems that for some strange reason the whole system was
installed to /dev/sdb.  Fixing these files (sdb - sda) and running
update-grub(8) resulted in a bootable system.

Befor debugging this further: is this a known problem?


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



how to reconstruct MD RAID device?

2005-08-24 Thread Jukka Salmi
Hi,

a Debian 3.1 system which uses md devices for all its file systems and
swap was reset by a power failure. On startup, the root file systems
md device failed to configure and is in degraded mode now. I think the
failed device is probably fine, but md configuration failed due to
parity errors or similar. After skimming through mdadm(8)'s man page
I still can't figure out what I need to do now, so help is appreciated.
Some data:

$ mount
/dev/md2 on / type ext3 (rw,errors=remount-ro)
[...]

$ cat /etc/mdadm/mdadm.conf
DEVICE partitions
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=[...]
   devices=/dev/hda3,/dev/hdb3
[...]

$ mdadm -D /dev/md2
/dev/md2:
Version : 00.90.01
  Creation Time : Fri Dec 17 12:05:14 2004
 Raid Level : raid1
 Array Size : 39107264 (37.30 GiB 40.05 GB)
Device Size : 39107264 (37.30 GiB 40.05 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 2
Persistence : Superblock is persistent

Update Time : Wed Aug 24 14:35:53 2005
  State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

   UUID : b631314e:ec41bac8:9656de45:6591d219
 Events : 0.2461867

Number   Major   Minor   RaidDevice State
   0   330  active sync   /dev/hda3
   1   00-  removed

$ dmesg
[...]
Kernel command line: root=/dev/md2 ro 
[...]
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: raid1 personality registered as nr 3
[...]
hda: max request size: 128KiB
hda: 80293248 sectors (41110 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100)
 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3
hdb: max request size: 128KiB
hdb: 80293248 sectors (41110 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100)
 /dev/ide/host0/bus0/target1/lun0: p1 p2 p3
md: md1 stopped.
md: bindhdb2
md: bindhda2
raid1: raid set md1 active with 2 out of 2 mirrors
md: md2 stopped.
md: bindhdb3
md: bindhda3
md: kicking non-fresh hdb3 from array!
md: unbindhdb3
md: export_rdev(hdb3)
raid1: raid set md2 active with 1 out of 2 mirrors
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: md2: orphan cleanup on readonly fs
ext3_orphan_cleanup: deleting unreferenced inode 1667940
EXT3-fs: md2: 1 orphan inode deleted
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Adding 976632k swap on /dev/md1.  Priority:-1 extents:1
EXT3 FS on md2, internal journal
Generic RTC Driver v1.07
SCSI subsystem initialized
Capability LSM initialized
md: md0 stopped.
md: bindhdb1
md: bindhda1
raid1: raid set md0 active with 2 out of 2 mirrors
[...]


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: how to reconstruct MD RAID device?

2005-08-24 Thread Jukka Salmi
Clive Menzies -- debian-user (2005-08-24 14:22:39 +0100):
 On (24/08/05 14:45), Jukka Salmi wrote:
  a Debian 3.1 system which uses md devices for all its file systems and
  swap was reset by a power failure. On startup, the root file systems
  md device failed to configure and is in degraded mode now. I think the
  failed device is probably fine, but md configuration failed due to
  parity errors or similar. After skimming through mdadm(8)'s man page
  I still can't figure out what I need to do now, so help is appreciated.
 
 What is the output of:
 
 $  cat /proc/mdstat

Sorry, I forgot to add that...

$ cat /proc/mdstat
Personalities : [raid1] 
md0 : active raid1 hda1[0] hdb1[1]
  62400 blocks [2/2] [UU]
  
md2 : active raid1 hda3[0]
  39107264 blocks [2/1] [U_]
  
md1 : active raid1 hda2[0] hdb2[1]
  976640 blocks [2/2] [UU]
  
unused devices: none


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: how to reconstruct MD RAID device?

2005-08-24 Thread Jukka Salmi
Clive Menzies -- debian-user (2005-08-24 15:08:11 +0100):
 On (24/08/05 15:53), Jukka Salmi wrote:
  Clive Menzies -- debian-user (2005-08-24 14:22:39 +0100):
   On (24/08/05 14:45), Jukka Salmi wrote:
a Debian 3.1 system which uses md devices for all its file systems and
swap was reset by a power failure. On startup, the root file systems
md device failed to configure and is in degraded mode now. I think the
failed device is probably fine, but md configuration failed due to
parity errors or similar. After skimming through mdadm(8)'s man page
I still can't figure out what I need to do now, so help is appreciated.
   
   What is the output of:
   
   $  cat /proc/mdstat
  
  Sorry, I forgot to add that...
  
  $ cat /proc/mdstat
  Personalities : [raid1] 
  md0 : active raid1 hda1[0] hdb1[1]
62400 blocks [2/2] [UU]

  md2 : active raid1 hda3[0]
39107264 blocks [2/1] [U_]

  md1 : active raid1 hda2[0] hdb2[1]
976640 blocks [2/2] [UU]

  unused devices: none
 
 Have you tried something like:
 
 $ mdadm /dev/md2 -a /dev/hdb3

No. Unfortunately it's a production system, hence I'm a little bit
cautious with trying things... So, considering md2 is used as the
root file system device, is adding hdb3 to it as you describe dangerous?
What exactly does this command do? Does it also start reconstruction
onto hdb3? As you notice, I'm not familiar with Linux software RAID
at all...


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: how to reconstruct MD RAID device?

2005-08-24 Thread Jukka Salmi
Clive Menzies -- debian-user (2005-08-24 16:27:38 +0100):
 On (24/08/05 16:31), Jukka Salmi wrote:
  Clive Menzies -- debian-user (2005-08-24 15:08:11 +0100):
   Have you tried something like:
   
   $ mdadm /dev/md2 -a /dev/hdb3
  
  No. Unfortunately it's a production system, hence I'm a little bit
  cautious with trying things... So, considering md2 is used as the
  root file system device, is adding hdb3 to it as you describe dangerous?
  What exactly does this command do? Does it also start reconstruction
  onto hdb3? As you notice, I'm not familiar with Linux software RAID
  at all...
 
 Well, I'm no expert and I can understand your reluctance to experiment.
 
 It's been a while since I set up 3 RAID servers but I did find the
 following links helpful:
 # http://rootraiddoc.alioth.debian.org/
 # http://juerd.nl/site.plp/debianraid
 # http://xtronics.com/reference/SATA-RAID-Debian.htm
 
 As I understand it, adding hdb3 to the /dev/md2 will reassemble the
 array; however, if hdb3 has become corrupted in some way, it may fail if
 it can't recover but this should have no adverse impact on hda3.

I added the non-fresh device to the failed md:

$ mdadm /dev/md2 -a /dev/hdb3
mdadm: hot added /dev/hdb3

and could see hda3 being rebuilt onto the new spare:

Aug 24 17:11:12 sv005 kernel: md: trying to hot-add unknown-block(3,67) to md2 
... 
Aug 24 17:11:12 sv005 kernel: md: bindhdb3
Aug 24 17:11:12 sv005 kernel: RAID1 conf printout:
Aug 24 17:11:12 sv005 kernel:  --- wd:1 rd:2
Aug 24 17:11:12 sv005 kernel:  disk 0, wo:0, o:1, dev:hda3
Aug 24 17:11:12 sv005 kernel:  disk 1, wo:1, o:1, dev:hdb3
Aug 24 17:11:12 sv005 kernel: md: syncing RAID array md2
Aug 24 17:11:12 sv005 kernel: md: minimum _guaranteed_ reconstruction speed: 
1000 KB/sec/disc.
Aug 24 17:11:12 sv005 kernel: md: using maximum available idle IO bandwith (but 
not more than 20 KB/sec) for reconstruction.
Aug 24 17:11:12 sv005 kernel: md: using 128k window, over a total of 39107264 
blocks.

Excellent! Unfortunately, some minutes after the sync failed because
of errors on the good disk:

Aug 24 17:16:06 sv005 kernel: hda: dma_intr: status=0x51 { DriveReady 
SeekComplete Error }
Aug 24 17:16:06 sv005 kernel: hda: dma_intr: error=0x40 { UncorrectableError }, 
LBAsect=80293024, sector=80293024
Aug 24 17:16:06 sv005 kernel: end_request: I/O error, dev hda, sector 80293024
[...]
Aug 24 17:16:27 sv005 kernel: md: md2: sync done.
Aug 24 17:16:27 sv005 kernel: md: syncing RAID array md2
[...]
Aug 24 17:17:01 sv005 kernel: hda: dma_intr: status=0x51 { DriveReady 
SeekComplete Error }
Aug 24 17:17:01 sv005 kernel: hda: dma_intr: error=0x01 { AddrMarkNotFound }, 
LBAsect=2078496, sector=2078496
Aug 24 17:17:01 sv005 kernel: hda: DMA disabled
Aug 24 17:17:01 sv005 kernel: hdb: DMA disabled
Aug 24 17:17:01 sv005 kernel: ide0: reset: success
Aug 24 17:17:01 sv005 kernel: hda: task_in_intr: status=0x59 { DriveReady 
SeekComplete DataRequest Error }
Aug 24 17:17:01 sv005 kernel: hda: task_in_intr: error=0x01 { AddrMarkNotFound 
}, LBAsect=2078496, sector=2078496
[...]

Seems I need to replace the disk or the controller. At least I know
now how to reconstruct a failed device.

Thank you for your help!


Regards, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Shell scripting

2004-05-07 Thread Jukka Salmi
Hi Pete,

 I have a script that performs batch zipping of files. Trouble is that it
 only does one file at a time (kind of going against the batch idea).
 Could someone point out the silly mistake I am obviously making?

[...]

 #!/bin/sh
 #
 # batch zip
 # invoke with batchzip filespec
 #
 # this will zip all files in the current directory that conform
 # to the file spec.
 #
 ZIP=/usr/bin/zip
 ARGS=-mT
 
 if [ -n $1 ]
 then
 if [ -x $ZIP ]
 then
 nofiles=0
 
 for file in $1

That's the problem: you ignore all arguments but the first. Try changing
this line to

  for file

  do
 filename=${file%.*}
 echo Adding $file to $filename.zip...
 $ZIP $ARGS $filename $file  /dev/null
 
 let nofiles += 1
 done
 
 echo
 echo finished ... processed $nofiles files.
 echo
 retval=0
 else
 echo
 echo Could not find 'zip'. Please check the path.
 echo
 retval=2
 fi
 else
 echo
 echo Usage : `basename $0` filespec
 echo
 retval=1
 fi
 
 exit $retval


HTH, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: random segfaults with Debian testing on i386

2004-04-09 Thread Jukka Salmi
Roberto Sanchez -- debian-user (2004-04-08 11:20:33 -0400):
 Jukka Salmi wrote:
 Hi,
 
 I just installed Debian testing on two DELL PowerEdge systems (PE 1750
 and PE 2650). On the 1750, Debian runs fine. But on the 2650, some programs
 segfault sometimes. I saw sshd, nvi, apt-get, less and dselect segfault.
 However, they don't always segfault, e.g. sometimes they run, sometimes
 they segfault. But once they segrault they won't run until the next reboot.
 
 For me this looks like bad hardware. Could it be something else?
 
 Hints are appreciated!
 
 Jukka
 
 
 How is the system load?  What is the CPU temp?

System load wasn't high at all, just as the CPU temperature.

Another strange thing: I installed NetBSD (1.6.2 stable) on the box,
and it runs fine without any problems so far... Can't do it now, but
I'll reinstall Debian next Tuesday and see if the problems still exist.


Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



random segfaults with Debian testing on i386

2004-04-08 Thread Jukka Salmi
Hi,

I just installed Debian testing on two DELL PowerEdge systems (PE 1750
and PE 2650). On the 1750, Debian runs fine. But on the 2650, some programs
segfault sometimes. I saw sshd, nvi, apt-get, less and dselect segfault.
However, they don't always segfault, e.g. sometimes they run, sometimes
they segfault. But once they segrault they won't run until the next reboot.

For me this looks like bad hardware. Could it be something else?

Hints are appreciated!

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



debootstrap problem

2004-01-07 Thread Jukka Salmi
Hi,

I'm trying to install sarge on a i386 system. debootstrap fails as
follows:

# debootstrap --arch i386 sarge /troot http://mirror
I: Retrieving debootstrap.invalid_dists_sarge_Release
I: Validating debootstrap.invalid_dists_sarge_Release
I: Retrieving debootstrap.invalid_dists_sarge_main_binary-i386_Packages
I: Validating debootstrap.invalid_dists_sarge_main_binary-i386_Packages
I: Checking adduser...
[...]
I: Checking zlib1g...
I: Retrieving adduser
I: Validating adduser
[...]
I: Retrieving zlib1g
I: Validating zlib1g
I: Extracting base-files...
[...]
I: Extracting mbr...
I: Installing core packages...
Selecting previously deselected package base-files.
(Reading database ... 0 files and directories currently installed.)
Unpacking base-files (from .../base-files_3.0.12_i386.deb) ...
Selecting previously deselected package base-passwd.
Unpacking base-passwd (from .../base-passwd_3.5.5_i386.deb) ...
dpkg: base-passwd: dependency problems, but configuring anyway as you request:
 base-passwd depends on libc6 (= 2.3.2.ds1-4); however:
  Package libc6 is not installed.
Setting up base-passwd (3.5.5) ...
cp: error while loading shared libraries: libacl.so.1: cannot open shared object file: 
No such file or directory
dpkg: error processing base-passwd (--install):
 subprocess post-installation script returned error exit status 127
dpkg: base-files: dependency problems, but configuring anyway as you request:
 base-files depends on awk; however:
  Package awk is not installed.
 base-files depends on base-passwd (= 2.0.3.4); however:
  Package base-passwd is not configured yet.
Setting up base-files (3.0.12) ...
cp: error while loading shared libraries: libacl.so.1: cannot open shared object file: 
No such file or directory
dpkg: error processing base-files (--install):
 subprocess post-installation script returned error exit status 127
Errors were encountered while processing:
 base-passwd
 base-files
W: Failure trying to run: chroot /troot dpkg --force-depends --install 
/var/cache/apt/archives/base-files_3.0.12_i386.deb 
/var/cache/apt/archives/base-passwd_3.5.5_i386.deb


I remember having done this a few months ago without any problems...

Help is appreciated!

TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: debootstrap problem

2004-01-07 Thread Jukka Salmi
Colin Watson -- debian-user (2004-01-07 14:44:43 +):
 Are you using the most current version of debootstrap from unstable? You
 always want to do this. Specifically your problem looks like:
 
 debootstrap (0.2.21) unstable; urgency=high
 
   * [sarge] Added coreutils' new predependencies libacl1 and libattr1; removed
 libsasl2 as it is no longer needed.

Using the latest debootstrap solved my problem. Thanks a lot!

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



official testing jigdo files

2003-12-12 Thread Jukka Salmi
Hi,

where have the official jigdo files for sarge gone? They used to be on
http://gluck.debian.org/cdimage/testing/jigdo-area/ (they are linked
from http://www.debian.org/CD/jigdo-cd/ (Available images)), but I get
HTTP 404...

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: troubles with tar, compression and cron

2003-12-11 Thread Jukka Salmi
Hello,

I still couldn't solve my problem. I stripped down the script to the
following:

$ cat ~/bin/tapetest
#!/bin/sh
cd /
/bin/tar -czf /dev/nst0 dir
echo tar returned $?

Running it manually gives:

$ ~/bin/tapetest
tar returned 0

...but when run from cron I get:

tar (grandchild): gzip: Cannot exec: No such file or directory
tar (grandchild): Error is not recoverable: exiting now
tar returned 141

As said before, the same happens if I use bzip2 in place of gzip (except
the above error message from tar is 'bzip2: Cannot exec:', of course...).
Using no compression works fine even with cron...

This is on a Debian testing i386 system. I'm using tar 1.13.25-6 and
cron 3.0pl1-81.


Any help is appreciated!

TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: troubles with tar, compression and cron

2003-12-11 Thread Jukka Salmi
Colin Watson -- debian-user (2003-12-11 12:24:07 +):
 Sounds like your cron job doesn't have an appropriate path. Try setting
 PATH=/usr/bin:/bin explicitly at the top, adding any other directories
 you need.

That's it! There was a typo in cron's $PATH. Thanks a lot!

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



troubles with tar, compression and cron

2003-12-10 Thread Jukka Salmi
Hi,

I wrote a script which uses tar to backup a filesystem to a Seagate DAT.
If I run the script from the shell it works fine, but when started by cron
(as root) I get this:

tar (grandchild): gzip: Cannot exec: No such file or directory
tar (grandchild): Error is not recoverable: exiting now
/dev/nst0: Device or resource busy

The command which causes this error is 'tar -czf /dev/nst0 ...'. The same
error happenes if I use bzip2 (tar -j). Not using compression at all solves
the problem, but I'd really like to store the data compressed...

Any hints?


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



installing Debian...

2003-10-20 Thread Jukka Salmi
Hello,

every now and then I install Debian on new ix86 machines (Dell PowerEdge).
They often have hardware which is not yet supported by the kernels of the
official stable Debian release 3.0r1. So far I was using an unofficial
stable netinst boot CD to install the OS.
I also tried a few testing CDs (official and unofficial, downloaded using
jigdo), but without success: segfaults when selecting keyboard layout, etc.

What I'd like to have is a bootable Debian CD with a recent kernel and a
working setup program. What's the easiest way to get / create such a CD?


Help is appreciated!

TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



LFS problem with Debian testing

2003-08-20 Thread Jukka Salmi
Hello,
I'm having problems with opening large (2 GB) files on a Debian testing
System:

---
#include sys/types.h
#include sys/stat.h
#include fcntl.h
[...]
int fd;
fd = open(argv[1], O_RDONLY | O_LARGEFILE);
[...]
---

gcc complains that O_LARGEFILE is undeclared. However, if I
#define O_LARGEFILE 010
the program works.

What am I doing wrong? Is there a problem with the header files? I'm using
libc6 2.3.1-16 and gcc 3.3.1 (both latest Debian testing packages) on a
i386 system.


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: LFS problem with Debian testing

2003-08-20 Thread Jukka Salmi
Damien Solley -- debian-user (2003-08-20 19:37:28 +1000):
 Old kernel version? AFAIK, you need a recent (ish) kernel to create
 files greater than 2GB.

$ uname -sr
Linux 2.4.21-3-686-smp

It's the latest kernel from the kernel-image-2.4-686-smp package.


Greetings, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



LFS problem with Debian testing

2003-08-20 Thread Jukka Salmi
Hello,

I'm having problems with opening large (2 GB) files on a Debian testing
system:

---
#include sys/types.h
#include sys/stat.h
#include fcntl.h
[...]
int fd;
fd = open(argv[1], O_RDONLY | O_LARGEFILE);
[...]
---

gcc complains that O_LARGEFILE is undeclared. However, if I
#define O_LARGEFILE 010
the program works.

What am I doing wrong? Is there a problem with the header files? I'm using
libc6 2.3.1-16 and gcc 3.3.1 (both latest Debian testing packages) on a
i386 system.


TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: LFS problem with Debian testing

2003-08-20 Thread Jukka Salmi
Hi,

Colin Watson -- debian-user (2003-08-20 11:55:14 +0100):
 Try building with the -D_FILE_OFFSET_BITS=64 option. See 'info libc'
 under Feature Test Macros for more details.

Does not help, same result as before...

Thanks anyway,

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: LFS problem with Debian testing

2003-08-20 Thread Jukka Salmi
Damien Solley -- debian-user (2003-08-20 21:09:16 +1000):
 Also, what file system are you using? Smbfs, fat and nfs all
 have issues with lfs that ext doesn't.

I'm using ext3 and ReiserFS (3.6.x), they both have full LFS support.
But I'm having problems during compile time, so the file system should
not be important yet.

Cheers, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: LFS problem with Debian testing

2003-08-20 Thread Jukka Salmi
Damien Solley -- debian-user (2003-08-20 21:09:16 +1000):
 Check out:
 http://www.suse.de/~aj/linux_lfs.html

I read this article and followed the instructions, without success.
Neither compiling with '-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE'
nor adding O_LARGEFILE to the flags for open(2) works for me. As you
said, both my kernel and libc should support files 2GB...

Thanks for everyone's help so far!

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: LFS problem with Debian testing

2003-08-20 Thread Jukka Salmi
Colin Watson -- debian-user (2003-08-20 16:50:50 +0100):
 Oh, um, sorry, let's test this time.
 
 Either use -D_FILE_OFFSET_BITS=64, in which case I believe you can
 simply drop the O_LARGEFILE option as open() will support opening large
 files by default; or else use -D_LARGEFILE64_SOURCE.

Perfect, both approaches work. Thanks a lot!

Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]