Mailinglist Archive: opensuse-de (1756 mails)
| < Previous | Next > |
Re: USB-Stick per Script formatieren (mit mount-Problem)
- From: Al Bogner <suse-linux@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Oct 2006 16:50:40 +0000 (UTC)
- Message-id: <200610271850.05840.suse-linux@xxxxxxxxxxxxxxxxxxxx>
Am Freitag, 27. Oktober 2006 13:47 schrieb David Haller:
Hallo David,
> >Wie mounte ich alle vorhandenen Partitionen automatisch ähnlich den
> >awk-umount-Konstrukt? Als Problem sehe ich die Zuordnung der mountpoints.
>
> Ohne, dass die Partitionen in der fstab stehen? /proc/partitions auslesen?
>
> >Zur Zeit habe ich:
> >
> >MOUNTVERZEICHNIS="/mnt"
> >awk -v dev="$USBGERAET" '$1 ~ dev { print "umount "$1; }' /proc/mounts |
> > sh -x mount "$USBGERAET"1 "$MOUNTVERZEICHNIS"
> >ls -la "$MOUNTVERZEICHNIS"
> >
> >Das reicht solange nur 1 primäre Partition verwendet wird.
> >
> >Ich stelle mir vor, dass ich vorsichtshalber alle Partitionen abmelde
> >und dann dynamische Mountpoints generiere.
>
> MOUNTVERZEICHNIS="/mnt"
> awk -v dev="$USBGERAET" '$1 ~ dev { print "umount "$1; }' /proc/mounts | sh
> -x
>
> # bitte erst ohne das "| sh -x" testen!
> awk -v dev="$USBGERAET" \
> -v mp="$MOUNTVERZEICHNIS" \
> '$4 ~ dev"[0-9]+" {
> print "mkdir -p " mp "/" $4;
> print "mount -t auto /dev/" $4 " " mp "/" $4;
> }' /proc/partitions | sh -x
>
> ls -la "${USBGERAET}"*/
>
> Oder so ;)
Ich komme nicht dahinter, wo das Problem ist:
ls: /dev/sde*/: Datei oder Verzeichnis nicht gefunden
Al
Hallo David,
> >Wie mounte ich alle vorhandenen Partitionen automatisch ähnlich den
> >awk-umount-Konstrukt? Als Problem sehe ich die Zuordnung der mountpoints.
>
> Ohne, dass die Partitionen in der fstab stehen? /proc/partitions auslesen?
>
> >Zur Zeit habe ich:
> >
> >MOUNTVERZEICHNIS="/mnt"
> >awk -v dev="$USBGERAET" '$1 ~ dev { print "umount "$1; }' /proc/mounts |
> > sh -x mount "$USBGERAET"1 "$MOUNTVERZEICHNIS"
> >ls -la "$MOUNTVERZEICHNIS"
> >
> >Das reicht solange nur 1 primäre Partition verwendet wird.
> >
> >Ich stelle mir vor, dass ich vorsichtshalber alle Partitionen abmelde
> >und dann dynamische Mountpoints generiere.
>
> MOUNTVERZEICHNIS="/mnt"
> awk -v dev="$USBGERAET" '$1 ~ dev { print "umount "$1; }' /proc/mounts | sh
> -x
>
> # bitte erst ohne das "| sh -x" testen!
> awk -v dev="$USBGERAET" \
> -v mp="$MOUNTVERZEICHNIS" \
> '$4 ~ dev"[0-9]+" {
> print "mkdir -p " mp "/" $4;
> print "mount -t auto /dev/" $4 " " mp "/" $4;
> }' /proc/partitions | sh -x
>
> ls -la "${USBGERAET}"*/
>
> Oder so ;)
Ich komme nicht dahinter, wo das Problem ist:
ls: /dev/sde*/: Datei oder Verzeichnis nicht gefunden
Al
| < Previous | Next > |