Sponsored Content
Top Forums Shell Programming and Scripting Partitioning script for rescue mode (disk size calculation) Post 302219576 by pug123 on Tuesday 29th of July 2008 02:05:06 PM
Old 07-29-2008
Hello!

I found some script on other forum and rebuilt it.
It works
Code:
#!/bin/bash

DSIZE=`fdisk -l /dev/sda | grep "Disk /dev/sda" | cut -f 3 -d " " | awk -F "." {'print $1'}`
SWAPSIZE=4;
DATASIZE=$[$DSIZE-$SWAPSIZE];
echo "Disk size:               $DSIZE GB";
echo "Size for data partition: $DATASIZE GB";
echo "Size for swap partition: $SWAPSIZE GB";

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Hard Disk partitioning to use UNIX

Hello, To run UNIX, can the hard disk be partitioned so I could use that part for UNIX and the other for my existing Windows '98? At the moment there are hard drives C: & D:. Also, where can I obtain the UNIX software?.....Your response is appreciated. (2 Replies)
Discussion started by: hpin
2 Replies

2. UNIX and Linux Applications

Xen VM rescue mode

Hi all, I am running xen virtual machine on centos 5 and xen gust o.s is centos. I cannot boot my xen vm machine it saying cannot find /bin/sh to execute. I want to go to rescue mode of my xen vm machine. I know how to do on actual physical machine but how i can enter in rescue mode of... (1 Reply)
Discussion started by: email-lalit
1 Replies

3. Solaris

disk partitioning

Total disk size is 38912 cylinders Cylinder size is 32130 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === ... (2 Replies)
Discussion started by: seyiisq
2 Replies

4. Linux

Xen VM rescue mode

Hi all, I am running xen virtual machine on centos 5 and xen gust o.s is centos. I cannot boot my xen vm machine it saying cannot find /bin/sh to execute. I want to go to rescue mode of my xen vm machine. I know how to do on actual physical machine but how i can enter in rescue mode of... (6 Replies)
Discussion started by: email-lalit
6 Replies

5. Solaris

Partitioning hard disk. Want 8 slices...have 9

Hi all I'm having difficulty setting up a proper disk structure on a 72GB HDD. The drive was previously part of a zfs pool. The zpool has ben destroyed and now I want to use the disk in a raid 5 array. I need to partition the disk accordingly though. This is what the partition table currently... (7 Replies)
Discussion started by: notreallyhere
7 Replies

6. Red Hat

Disk partitioning commands for RHEL5

I'm new to Linux 5, going through initial phases of installation and setting up devices, etc,, and much to my surprise discovered also an existence of a 2nd hard drive to try to initialize and partition perhaps using any built-in command i.e. "fdisk" or similar, but I couldn't get the command to... (4 Replies)
Discussion started by: su
4 Replies

7. Red Hat

I cannot find ext2online or resize2fs in RHEL 4 rescue mode

Hi, I'm trying to resize an ext3 FS (filesystem) under an LVM. I have booted the OS (RHEL 4) in rescue mode using the CD media and I'm able to use lvm commands. Now, I'm trying to shrink the filesystem before actually shrinking the logical volume but I cannot find ext2onlone or resize2fs... (1 Reply)
Discussion started by: verdepollo
1 Replies

8. Red Hat

You' dont have any Linux partition- Rescue Mode

I accidently deleted fstab file from one of the compute nodes of the cluster (RHEL 5.3). Due to this no filesystem/directory is mounted on the system during bootup. I started system in rescue mode but it says You don't have any linux partitions. Press return to get a shell. The system will reboot... (2 Replies)
Discussion started by: ahsanpmd
2 Replies

9. UNIX for Dummies Questions & Answers

How to get cpanel backup data in rescue mode?

How to get cpanel backup data in rescue mode? Server OS 6.3 minimal with cPanel /dev/sdb1 is main partition root@rescue ~ # fdisk -l Anyone can help Thank you (0 Replies)
Discussion started by: jaydul
0 Replies

10. UNIX for Beginners Questions & Answers

How to fix and manage data in rescue mode?

Hello, I am running ubuntu 14.04 My server has problems again. I need to manage system files in rescue mode, backup some files, edit /etc/crontab and rc.local files etc. root@rescue:~# cat /proc/mdstat Personalities : md2 : active raid1 sda2 sdb2 4193216 blocks md3 :... (4 Replies)
Discussion started by: baris35
4 Replies
PCINITRD(8)						      System Manager's Manual						       PCINITRD(8)

NAME
pcinitrd - create a PCMCIA initrd ram disk image SYNOPSIS
pcinitrd [-v] [-a] [--all] [-d alternate-root] [--dir=alternate-root] [-r kernel-release] [--release=kernel-release] [-s image-size] [--size=image-size] [-u] [--update] initrd-image [modules ...] DESCRIPTION
The pcinitrd script creates an initrd ram disk image for booting with the root filesystem on a PCMCIA device. If the target is a block special device (i.e., /dev/fd0), then the initrd image is created on that device. If the target does not already exist or if it is an ordinary file, then pcinitrd will create the image file using the ``loopback'' device. Modules are specified with paths relative to /lib/modules/[kernel-release]. The core PCMCIA modules (pcmcia/pcmcia_core and pcmcia/ds) will automatically be installed in the target image. All other device-specific modules need to be listed on the command line, along with the appropriate socket driver (pcmcia/i82365.o or pcmcia/tcic.o). Alternatively, if -a is specified, then all available PCMCIA socket drivers and block device drivers will be included in the image. Additional files to be copied to the initrd image may also be listed on the command line. Executable programs will be installed in /bin, shared libraries will be installed in /lib, device files will be installed in /dev, and any other files will be placed in /etc. The startup script in the resulting image, linuxrc, may need to be customized for a particular system. It contains the same variable defi- nitions as the normal PCMCIA startup scripts (i.e., PCIC=, PCIC_OPTS=, and CORE_OPTS= variables). The /etc/config.opts file may also need to be edited. Any changes to linuxrc or config.opts will be preserved if pcinitrd is executed in ``update'' mode. Another feature of the generated linuxrc is that if the DEBUG variable is set to a non-blank string at the boot prompt, then cardmgr will echo all its status messages to the console, and after linuxrc executes, it will fire up a shell on the console. This can be helpful for debugging initrd problems. However, few commands are available in the normal initrd environment. OPTIONS
-v Verbose mode. Identify files as they are copied. -a, --all Install all socket drivers and block-style PCMCIA device drivers, including memory card, SCSI card, and fixed-disk drivers. This is mainly intended for use by package maintainers. -d alternate-root, --dir=alternate-root Specifies an alternate directory tree to search for all the files used to put together the initrd image. This may be helpful for running pcinitrd after booting from an installation or rescue diskette. -r kernel-release, --release=kernel-release Specifies the kernel release number (i.e., 2.0.28) to use when looking for modules in /lib/modules. The default is the release of the running kernel. -s image-size, --size=image-size Specifies the filesystem size to create on the target file or device, in 1k blocks. The default is 2400. -u, --update Update mode: updates cardmgr and all the kernel modules in an existing initrd image, but does not modify other files. AUTHOR
David Hinds - dahinds@users.sourceforge.net SEE ALSO
pcmcia(5), cardmgr(8), lilo(8). pcmcia-cs $Date PCINITRD(8)
All times are GMT -4. The time now is 08:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy