Welcome
Welcome to refracta

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Automatic fstab update scripts

Stuff that has not yet gone into the official build.

Re: Automatic fstab update scripts

Postby dzz » Fri Feb 03, 2012 5:12 pm

Getting there... probably still more to do...

Updated to configure-mounts_0.4 (same url)

should autodetect up to 2 TYPE="crypto_LUKS" (as seen by blkid) volumes and exclude them when setting up linux parts.

Tested here (only, so far) with one newly-made LUKS partition. Script does not now hang. Existing fstab entry is kept, it's "raw device" gets excluded from appends. Whether or not it is open or mounted already.

mount -a is not a problem, if the LUKS is not open, simply the message:

Code: Select all
mount: special device /dev/mapper/sdc2 does not exist

Also, a grep error when processing a swapfile is (seemingly) fixed
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Automatic fstab update scripts

Postby fsmithred » Wed Feb 08, 2012 5:25 pm

I finally rebooted my main computer and tested configure-mounts_0.4+2.sh while running from usb. The script saw and added lines to fstab for both sda1 and sdb1 as it should have. Got an error message (again) about too many arguments in line 275. Fixed it by quoting the string in the test...
Code: Select all
if [ "$ROOTPARTDEV" = /dev/${REMOVABLE1}[0-9] ]; then

changed to
Code: Select all
if [ "$ROOTPARTDEV" = "/dev/${REMOVABLE1}[0-9] ]"; then
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: Automatic fstab update scripts

Postby dzz » Thu Feb 09, 2012 12:08 am

Thanks for pointing that error out (and all the other tests)

I had trouble with that line before. Please correct me if I am wrong but I didn't believe a "glob", [0-9], if it's in quotes, works properly like that in a conditional (and clearly doesn't behave without either, "too many arguments" ) EDIT These errors don't show in all setups the script may run in

So I made $ROOTPARTDEV just the device, (e.g. /dev/sdb) and used $ROOTPART (e.g. /dev/sdb1) everywhere else for the actual partition, now the "glob" is removed

Actually, I dont think a "real" usb install shows up as a removable, it didn't on an install here last time I looked (can't test that today) so the line in question might be redundant anyway. It's only to stop removables getting fstab entries.

Updated version (keeping older ones there for now) :
http://exe-linux.fastfishwebsolutions.c ... s_0.4+3.sh
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Automatic fstab update scripts

Postby fsmithred » Fri Feb 10, 2012 5:04 pm

I don't know exactly why there's a problem, but it's acting like word splitting is going on, so I tried quoting it, and it worked. Another solution would be to use the bash extended test ( [[ ) instead of ( [ ). I haven't tried the revised version (+3) yet.

Here are the last versions of mount and unmount crypto.
https://github.com/fsmithred/scripts/bl ... rypto03.sh
https://github.com/fsmithred/scripts/bl ... rypto03.sh
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Previous

Return to Experimental

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred