Superpatterns Pat Patterson on the Cloud, Identity and Single Malt Scotch

22Mar/060

Reworked script to remount USB drives on SuSE 10.0

I realised that I could generalize yesterday's 'remount' script to remount all subfs filesystems. Here is the new version:

#! /bin/sh
# Look for any filesystems mounted as subfs, unmount them,
# then remount them manually
mount -t subfs \
| awk '{print "echo Remounting " $1 " on " $3 "; umount " $1 " && mount " $1 " " $3}' \
| sh

I'm sure you could use Perl for this instead of Awk, but my skillz are little more old skool

I need hardly add that these shell scripts are totally unwarranted. Use them at your own risk. I or Sun cannot be held responsible if, after running either of these scripts, you lose data, money or friends.

Filed under: General Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.