Posts

Showing posts from November, 2018

Increasing partition of a SD card

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I have a SD card that has two partitions /dev/sdb1 that holds the boot sector, and /dev/sdb2 that holds the OS. The card still has unpartitioned free space. How can I take all the unpartitioned free space and add it to /dev/sdb2 without formatting the drive? I want to do this in on command line only linux ubuntu partition fsck share | improve this question edited Sep 23 '15 at 19:02 asked Sep 23 '15 at 18:55 Kousha 285 3 16 See man resize2fs . – goldilocks Sep 23 '15 at 19:04 The sequence of steps is: 1. resize the partition, using any appropriate tool ( fdisk , cfdisk , gdisk , &c.), and 2. resize the filesystem, using resize2fs (most likely; there are different tools for different FSs). If you want, you can use gparted to do it automatically. – Tom Hunt Sep 23 '15 at 20:17 @goldilocks, I did use resize2fs ...

Export commands works in interactive mode, but produces error message in script [duplicate]

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite This question already has an answer here: How can I make environment variables “exported” in a shell script stick around? 2 answers What's the difference between “export” and “setenv”? 1 answer I need to export an environmental variable to run a program. I am able to successfully do that in interactive mode. However, when I try to export an environmental variable as part of a bash shell script, I get this error message: export: Command not found. In interactive mode, when I type in the following command, it works. export GT_DIR=/cluster/home/SD/ But when I include the export command as part of the shell script, it does not work. I.e., #!/bin/bash export GT_DIR=/cluster/home/SD/ I get the error message: export: Command not found. When I type in echo $SHELL , I get /bin/bash Why is the export command working in interactive mode but not when I try to submit it as a scr...