Mailinglist Archive: opensuse-de (1756 mails)
| < Previous | Next > |
Re: USB-Stick per Script formatieren (mit mount-Problem)
- From: David Haller <lists@xxxxxxxxxx>
- Date: Sun, 22 Oct 2006 16:24:42 +0000 (UTC)
- Message-id: <20061022160213.GA5520@xxxxxxxxxxxxxxxxxx>
Hallo,
Am Son, 22 Okt 2006, Al Bogner schrieb:
>Am Sonntag, 22. Oktober 2006 01:51 schrieb David Haller:
>> awk '/[ \t]sd[a-z][ \t]*/ { print "/dev/" $4; }' /proc/partitions
>> ^ das macht das Zeichen optional ;)
>>
>> Oder auch:
>>
>> awk '/[ \t]sd[a-z]$/ { print "/dev/" $4; }' /proc/partitions
>
>Beides funktioniert nun hier. Vielen Dank!
Prima.
[..]
>Kann man alle Partitionen eines Devices unmounten, zB so
>umount /dev/sda
>
>umount: /dev/sda: not mounted
Nein.
>Das stimmt natürlich, da der Stick total gelöscht wurde und keine Partitionen
>hat.
>
>Hast du eine Idee, wie man das mit eventuellem umount sauber hinbekommt?
Ich hab' sowas fuer die Platte, die ich normal schlafen lege:
awk '
/^[ \t]*#/ {
next;
}
$1 ~ /hdd/ {
print "umount "$1;
}' /proc/mounts | sh -x
Ich hoffe mal, das Format der /proc/mounts hat sich nicht
geaendert. Hier z.B.:
device MtPt fs opts ? ?
/dev/hda1 /mnt/hda1 ext3 rw 0 0
Du musst das /hdd/ natuerlich anpassen, und dir das richtige /dev/sd?
merken. Vielleicht legtst du mit dem script, in dem du nach der
ID_SERIAL suchst, in /var/run/ oder so eine Datei an, in der das
jew. Device drinsteht bzw. das "Grunddevice" sd[a-z]...
HTH,
-dnh
--
>Now, if I could just figure out how to get hold of egg yolks, without
>superfluous egg whites... -- S. Lamble
Why not leave them with the whites? Properly cared-for, in time they
will turn into a tasty chicken! -- Tanuki
Am Son, 22 Okt 2006, Al Bogner schrieb:
>Am Sonntag, 22. Oktober 2006 01:51 schrieb David Haller:
>> awk '/[ \t]sd[a-z][ \t]*/ { print "/dev/" $4; }' /proc/partitions
>> ^ das macht das Zeichen optional ;)
>>
>> Oder auch:
>>
>> awk '/[ \t]sd[a-z]$/ { print "/dev/" $4; }' /proc/partitions
>
>Beides funktioniert nun hier. Vielen Dank!
Prima.
[..]
>Kann man alle Partitionen eines Devices unmounten, zB so
>umount /dev/sda
>
>umount: /dev/sda: not mounted
Nein.
>Das stimmt natürlich, da der Stick total gelöscht wurde und keine Partitionen
>hat.
>
>Hast du eine Idee, wie man das mit eventuellem umount sauber hinbekommt?
Ich hab' sowas fuer die Platte, die ich normal schlafen lege:
awk '
/^[ \t]*#/ {
next;
}
$1 ~ /hdd/ {
print "umount "$1;
}' /proc/mounts | sh -x
Ich hoffe mal, das Format der /proc/mounts hat sich nicht
geaendert. Hier z.B.:
device MtPt fs opts ? ?
/dev/hda1 /mnt/hda1 ext3 rw 0 0
Du musst das /hdd/ natuerlich anpassen, und dir das richtige /dev/sd?
merken. Vielleicht legtst du mit dem script, in dem du nach der
ID_SERIAL suchst, in /var/run/ oder so eine Datei an, in der das
jew. Device drinsteht bzw. das "Grunddevice" sd[a-z]...
HTH,
-dnh
--
>Now, if I could just figure out how to get hold of egg yolks, without
>superfluous egg whites... -- S. Lamble
Why not leave them with the whites? Properly cared-for, in time they
will turn into a tasty chicken! -- Tanuki
| < Previous | Next > |