LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-10-2010, 07:19 AM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
need help with script syntax,etc


so I'm trying to make a live usb persistence wizard for Debian/Ubuntu
from SalixOS' source usbpersistencewizard

so, the ubuntu one works great
however the debian procedure for making a live-rw file is different than ubuntu's casper-rw file

casper-rw command
Code:
  SIZE=$1
FREE=$('df' -k .|tail -n1|awk '{print $4}')
AFTER=$(( $FREE - 1024 * $SIZE ))
if [ $AFTER -gt 0 ]; then
  dd if=/dev/zero of=casper-rw bs=1M count=$SIZE
  mkfs.ext3 -F casper-rw
live-rw command

Code:
SIZE=$1
FREE=$('df' -k .|tail -n1|awk '{print $4}')
AFTER=$(( $FREE - 1024 * $SIZE ))
if [ $AFTER -gt 0 ]; then
  dd if=/dev/null of=live-rw bs=$SIZE seek=1
  mkfs.ext2 -F live-rw
so, bs=$SIZE does not work because the command needs a M or G for MB or GB after it,etc
bs=1024M would create a 1gb live-rw file,etc

how do I add the M or G parameter to $SIZE?
thx
 
Old 09-10-2010, 07:25 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi

bs=${SIZE}M or bs=${SIZE}G

Hope this helps.
 
1 members found this post helpful.
Old 09-10-2010, 07:48 AM   #3
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
your sub-genius baby
thanks alot Druuna!

a little background; I'm adding this persistence wizard to my nFluxOS debian/ubuntu builds
as

a) debian doesn't have a gui way to create one

b) with ubuntu you must use usb-creator to make a casper-rw using gui

c) the persistence wizard also works off livecd too whereas ubuntu/debian doesn't have gui way to save stuff on livecd session
 
Old 09-10-2010, 07:53 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You're welcome
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Script syntax error fw12 Programming 3 07-10-2010 01:31 AM
is there a '?:' syntax shell script? logicalfuzz Linux - General 3 01-29-2010 09:26 AM
grep script/syntax carriehoff Linux - Newbie 6 08-31-2006 01:13 PM
Help with sh script syntax needed ! MikeAtVillage Programming 4 03-31-2006 02:39 AM
Shell Script Syntax dragon49 Programming 1 03-12-2003 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration