Koozali.org: home of the SME Server

Resize Hard Drive

Offline Bud

  • *
  • 487
  • +0/-0
Resize Hard Drive
« on: October 08, 2015, 07:38:22 PM »
guys please help

i have an sme server 9 with 1 x seagate 160gig drive

# smartctl -i /dev/sda
=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.11
Device Model:     ST3160813AS
Serial Number:    9SY30TZM
LU WWN Device Id: 5 000c50 019890c75
Firmware Version: CC2J
User Capacity:    160,041,885,696 bytes [160 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Thu Oct  8 19:31:28 2015 SAST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
====================================

#df -i
======================================
Filesystem            Inodes IUsed   IFree IUse% Mounted on
/dev/mapper/main-root
                     2182992 84638 2098354    4% /
tmpfs                 126281     1  126280    1% /dev/shm
/dev/md0               64000    48   63952    1% /boot
======================================

# fdisk -l
==============================
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcb5ae664

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          32      256000   fd  Linux raid autodetect
/dev/sda2              32        4866    38824960   fd  Linux raid autodetect

Disk /dev/md1: 39.7 GB, 39723073536 bytes
2 heads, 4 sectors/track, 9698016 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/main-root: 35.7 GB, 35718692864 bytes
255 heads, 63 sectors/track, 4342 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
=================================================

as you can see, even though it is a 160gig drive only 40gig is used by sme 9

when i try to resize in order to utilize all the remaining space ie: 120gig this is the output i get

http://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size

# mdadm --grow /dev/md2 --size=max
mdadm: error opening /dev/md2: No such file or directory

any idea what i need to issue, in order for me to use the full capacity of the drive?

any help greatly appreciated  :)
« Last Edit: October 09, 2015, 04:32:52 AM by Bud »

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Resize Hard Drive
« Reply #1 on: October 08, 2015, 07:47:58 PM »
please post the output of

Code: [Select]
cat /proc/mdstat

I guess you'd refer to /dev/md1

Offline Bud

  • *
  • 487
  • +0/-0
Re: Resize Hard Drive
« Reply #2 on: October 09, 2015, 04:28:27 AM »
thanks for helping Stefano

# cat /proc/mdstat
========================
Personalities : [raid1]
md0 : active raid1 sda1[0]
      255988 blocks super 1.0 [2/1] [U_]

md1 : active raid1 sda2[0]
      38792192 blocks super 1.1 [2/1] [U_]
      bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>
========================

what now?  :-)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Resize Hard Drive
« Reply #3 on: October 09, 2015, 04:54:24 AM »
Get a second drive and set up RAID1 before you do anything else.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Resize Hard Drive
« Reply #4 on: October 09, 2015, 09:53:16 AM »



md1 : active raid1 sda2[0]
      38792192 blocks super 1.1 [2/1] [U_]
      bitmap: 1/1 pages [4KB], 65536KB chunk

what now?  :-)

re-read my previous post ;-)
(hint: no md2 but md1)

BTW, follow Charlie's advice or, at least, be sure you have a good and working backup

Offline Bud

  • *
  • 487
  • +0/-0
Re: Resize Hard Drive
« Reply #5 on: March 07, 2017, 05:27:14 AM »
please guys i need your help

I have 2 x 500gb sata drives running raid

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[2]
      255936 blocks super 1.0 [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[2]
      38792192 blocks super 1.1 [2/2] [UU]
      bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>

fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xcb5ae664

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          32      256000   fd  Linux raid autodetect
/dev/sda2              32        4866    38824960   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          32      256000+  fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2              32       60802   488130583   fd  Linux raid autodetect

Disk /dev/md1: 39.7 GB, 39723204608 bytes
2 heads, 4 sectors/track, 9698048 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/main-root: 35.7 GB, 35718692864 bytes
255 heads, 63 sectors/track, 4342 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/main-swap: 4001 MB, 4001366016 bytes
255 heads, 63 sectors/track, 486 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/md0: 262 MB, 262078464 bytes
2 heads, 4 sectors/track, 63984 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

The 500gb Drives are only reporting a size of 40gb being used

Any ideas on what i can do   :)

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Resize Hard Drive
« Reply #6 on: March 07, 2017, 06:12:11 AM »
Bud

output of
df -h
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Resize Hard Drive
« Reply #7 on: March 07, 2017, 06:49:41 AM »
Follow the wiki page but remember you have to refer to md1
Code: [Select]
mdadm --grow /dev/md1 --size=max

Offline Bud

  • *
  • 487
  • +0/-0
Re: Resize Hard Drive
« Reply #8 on: March 08, 2017, 04:28:52 AM »
thank you for helping much appreciated

janet
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/main-root
                       33G   18G   14G  58% /
tmpfs                 3.8G     0  3.8G   0% /dev/shm
/dev/md0              239M   77M  150M  34% /boot

Stafano
# mdadm --grow /dev/md1 --size=max
mdadm: component size of /dev/md1 unchanged at 38792192K

# pvresize /dev/md1
  Physical volume "/dev/md1" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized

#lvresize -l +100%FREE main/root

# resize2fs /dev/mapper/main-root &
[1] 2265
[root@smeserver ~]# resize2fs 1.41.12 (17-May-2010)
The filesystem is already 8720384 blocks long.  Nothing to do!

any ideas?







Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Resize Hard Drive
« Reply #9 on: March 08, 2017, 10:17:33 AM »
ok..

first of all, can you give us some history details of this server?
it seems that sda has a small partition, while sdb is correctly partitioned

in your first post (2 years ago) you had a single 160 GB disk with a 40 GB partition
now you have 2 500 GB hds but partitioning scheme is not correct

how did you add your disks?

BTW

MAKE SURE YOU HAVE A GOOD BACKUP
- disconnect sda, try to reboot your server with sdb only.. if it works (it should), check your data is there
- if it works, "blank" your sda disk following this: https://wiki.contribs.org/Raid#Reusing_Hard_Drives
- shutdown your server, add sda, reboot, go to console and use "manage disk redundancy" menu item
- once the raid sync is finished, come here again and let's see how your server is

if the first task of the above list doesn't work, stop, reattach sda, reboot and come here again