Page 1 of 2

harddisk control (adding/changing)

Posted: Sun Jan 25, 2009 1:03 pm
by pbecks1963
Hello,

I would like to see a tool with which i can manage my harddrives. By mistake i have a lvm group set up off 3 ide harddisk's. I would like to change all that (some day). But in the mean time i want to add a fourth ide harddisk. (not necceseraly to the lvm!)

?

Re: harddisk control (adding/changing)

Posted: Sun Jan 25, 2009 1:41 pm
by cpg
is this guide on how to add drives to your amahi home server good for you?

Re: harddisk control (adding/changing)

Posted: Tue Jan 27, 2009 3:25 am
by pbecks1963
Hello cpg,

The script producess errors. I guess i'll have to start all over (re-installing amahi on the server) again to get things right.

Re: harddisk control (adding/changing)

Posted: Tue Jan 27, 2009 4:05 am
by moredruid
No you don't need to reinstall.
You can extend your lvm with a 4th disk.

As posted in the installation section I'm going to experiment a little bit with it and post a tutorial...
If you can wait a couple of days I'll have the tut posted.

Re: harddisk control (adding/changing)

Posted: Tue Jan 27, 2009 4:40 am
by pbecks1963
Ok, great.. I'll wait

Re: harddisk control (adding/changing)

Posted: Tue Jan 27, 2009 11:31 am
by cpg
The script producess errors. I guess i'll have to start all over (re-installing amahi on the server) again to get things right.
well, that is a solution, however, if you could copy the errors, it would be helpful to understand why and perhaps fix them.

it would be useful to everyone.

Re: harddisk control (adding/changing)

Posted: Tue Jan 27, 2009 11:59 am
by pbecks1963
Here they are!
**************************************************

[root@localhost Download]# sh Diskmounter.sh
Diskmounter.sh: line 37: fdisk: command not found
Diskmounter.sh: line 38: fdisk: command not found
Diskmounter.sh: line 39: fdisk: command not found
Diskmounter.sh: line 40: fdisk: command not found
[root@localhost Download]#
*******************************************************
Lines refered to in the above error's:

drivesntfs=`fdisk -l | grep -i 'ntfs' | awk -F '/| ' '{print $3}'`
drivesfat=`fdisk -l | grep -i 'fat32' | awk -F '/| ' '{print $3}'`
driveshfs=`fdisk -l | grep -i 'Apple_HFS' | awk -F '/| ' '{print $3}'`
drivesext=`fdisk -l | grep -i 'Linux' | grep -v 'swap' | awk -F '/| ' '{print $3}'`
********************************************************
mount-command:

[root@localhost Download]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
gvfs-fuse-daemon on /home/patrick/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=patrick)
[root@localhost Download]#
************************************************
command: fdisk -l

root@localhost Download]# /sbin/fdisk -l

Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x90909090

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 2434 19350292+ 8e Linux LVM

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 40.0 GB, 40037760000 bytes
255 heads, 63 sectors/track, 4867 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 4983 40021631+ ee EFI GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdc1 1 1 16+ ee EFI GPT
/dev/sdc2 * 1 9730 78150710+ 8e Linux LVM

WARNING: GPT (GUID Partition Table) detected on '/dev/sdd'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdd: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdd1 1 1 16+ ee EFI GPT
/dev/sdd2 * 1 9965 80043230+ 8e Linux LVM

Disk /dev/dm-0: 180.0 GB, 180019527680 bytes
255 heads, 63 sectors/track, 21886 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 1610 MB, 1610612736 bytes
255 heads, 63 sectors/track, 195 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-1 doesn't contain a valid partition table
[root@localhost Download]#
[root@localhost Download]#

Re: harddisk control (adding/changing)

Posted: Tue Jan 27, 2009 2:19 pm
by jfrenc14
it looks like you dont have fdisk installed, do

Code: Select all

su -c 'yum install fdisk'

Re: harddisk control (adding/changing)

Posted: Tue Jan 27, 2009 2:39 pm
by cpg
i think fdisk is installed by default. in fact, it looks like it is in /sbin, per his listing above.

i think this may fix it:

Code: Select all

su -
the dash (-) is very important. without it, the user environment is what is being used. i.e. PATH does not include /sbin, which is where fdisk is located.

that or logging in as su directly.

after the su -, then run the Diskmounter.sh script.

Re: harddisk control (adding/changing)

Posted: Wed Jan 28, 2009 12:32 am
by moredruid
fdisk is installed by default on every linux distro.

Code: Select all

root@localhost #
I think running su - doesn't really help here if you're logged on as root, you'll just spawn another bash instance.
however, if you're elevating your rights from a normal user to root, you MUST run the command like this:

Code: Select all

su -
this will spawn a root bash (or whatever you have defined) shell, and include all the environment variables (like PATH, EXPORT etc.)
without the "-" it will just run a root bash with loading the .bashrc from root, which might produce the error.