Hello. I've used these one-liners successfully to resize the existing FAT partition on a flash drive (to about 1GB), then add an ext2 partition to the remaining space.
But it doesn't work always. It seems to work at times only. If, later, I remove the partitions and reinstate the single FAT32 partition that uses the entire disk, I then get errors from parted when using these commands again. And I've gotten other random errors as well. I've read about the errors I received and evidently they are parted bugs, so I've lost confidence in using parted for my script.
I'm struggling a bit with figuring out the script equivalents for cfdisk, sfdisk or fdisk. Suggestions regarding how to script these specific tasks with other partition tools would be very much appreciated.
fdisk: old, reliable, more or less scriptable
cfdisk: pretty, easy to use, hell to script
sfdisk: ugly, very strict about syntax, no-nonsense interface, very scriptable
Um -- thanks, but I was hoping for some guidance on how to use those alternatives for the resizing and creation of partitions as shown with parted in my original post.
First: neither of them support resizing a partition by themselves, they only deal with the partition table. So the example above would require
resizing the filesystem (if supported)
recreating the (smaller) partition table entry
creating the new partition
creating a filesystem on the new partition
I'd suggest doing this by hand, using either fdisk or sfdisk, and writing down what you entered. You can then automate this by echo-ing it in, eg
would (assuming the partition table on /dev/sdg is blank) create a primary partiton, starting at cylinder 1, 1G in size, change the type of the partition to 'b' (W95 FAT32), activate the bootflag, and write the partition table to the disk.
In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ?
--- Post updated at 08:39 AM ---
in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
So I'm trying to pass certain json elements as env vars and use them later on in a script.
Sample json:
JSON='{
"Element1": "file-123456",
"Element2": "Name, of, company written in, a very weird way",
"Element3": "path/to/some/file.txt",
}'
(part of the) script:
for s... (5 Replies)
I am getting ready to install RHEL6 server. I have to create these partitions:
/ 10GB
SWAP 3GB
/opt/kent 10GB
/opt/kent/logs
/backup 20 GB
Will Gparted do this? or whats the easiest way? or even a tutorial?I am so new to this (4 Replies)
# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi
espeacailly the top regex part?
---------- Post updated at 06:58 PM ---------- Previous update was... (1 Reply)
Hi folks,
Ubuntu 10.04-1 64-bit
HD - 1T SATA3
I ran graphic installation installing Ubuntu-10.04-1 desktop from Live CD
The partition on the new HD is as follow;
/root
/home
/kvm
(kvm is for keeping the guests of KVM, the virtualizer)
Installion went through without problem abd... (0 Replies)
hi,
i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Hello!
I need to write partitioning script wich would work in rescue mode. It will prepare partitions and unpack linux on it. However I need to calculate whole size of the disk and create:
/dev/sda1 --> One big partition (minus (2*size of memory) for swap)
/dev/sda2 --> Swap partition... (1 Reply)
Hey, this question is generated purely out of my lack of knowledge.
Ok, obviously you can partition hard drives, I have Windows 2k, and can partition it from administrative tools, however, all of the help sections have utterly failed to give me any information other than "when you partition, it... (5 Replies)
Hi All,
I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl
FROM_DATE="06/05/2008"
TO_DATE="07/05/2008"
"perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename"
filename has... (10 Replies)