Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOmEQ-0003IA-9t for pgsql-general@arkaria.postgresql.org; Thu, 09 May 2019 16:49:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hOmEP-0006w1-4l for pgsql-general@arkaria.postgresql.org; Thu, 09 May 2019 16:49:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOmEO-0006tU-Nw for pgsql-general@lists.postgresql.org; Thu, 09 May 2019 16:49:16 +0000 Received: from mail-oln040092010057.outbound.protection.outlook.com ([40.92.10.57] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOmEL-0004au-NQ for pgsql-general@postgresql.org; Thu, 09 May 2019 16:49:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xvHzzfzxIutM0Fg2bzV0MjXiP0gOu3NMjXOz72TKfiE=; b=clYESX9PsgWHaVo6Q4nXdM2jC+esaJxFQcF43YHChEqzb7f7rTHkYVAN2vzyshLzt+COrRxyGO32WgEltrfh7forknOXisBr3MYHltVjGXUouc7mSCc1MZm9V6r4+1NQOW6bL5U6zBdm/C/LGu1rVYwiIxbjqdwijpVkAUw/Epb4qvdgMJeKX7tzEBtJUsCeriWw6YwR4rj4AoHNOelaACYKZJP76QppfoXoEof/YPPaiLBqTtlTCzJ/OkfbPxESsljLS7umCbW0KsyvecAQb86TqBL7D4kV8+VUtAZfyygFFccW5YX8ttzL6Dme5vETe8VJ+ryHE6D/YwR2i1yQ5Q== Received: from BN3NAM04FT060.eop-NAM04.prod.protection.outlook.com (10.152.92.60) by BN3NAM04HT129.eop-NAM04.prod.protection.outlook.com (10.152.93.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.15; Thu, 9 May 2019 16:49:10 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com (10.152.92.60) by BN3NAM04FT060.mail.protection.outlook.com (10.152.93.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.15 via Frontend Transport; Thu, 9 May 2019 16:49:10 +0000 Received: from BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::d9fb:bca2:3018:3513]) by BYAPR08MB5014.namprd08.prod.outlook.com ([fe80::d9fb:bca2:3018:3513%5]) with mapi id 15.20.1878.022; Thu, 9 May 2019 16:49:10 +0000 From: Julie Nishimura To: Alan Hodgson , pgsql-general Subject: Re: running out of disk space Thread-Topic: running out of disk space Thread-Index: AQHVBnx1Itguwr287EK9Sq96YQ2Sh6Zi9/EAgAAFm5w= Date: Thu, 9 May 2019 16:49:10 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:EFE2C23A06AECD1A2DD731D13FE2FEED15611DC2D11C5C652F1BD16CD0E335F4;UpperCasedChecksum:7AF563922067E7D517E6E9FABDA24F88CA498A6E674752FF0981AD7FD2DB2A67;SizeAsReceived:6835;Count:43 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [1Nkn92u70Muj4mD2FJQlcCCAL8lOatHN] x-ms-publictraffictype: Email x-incomingheadercount: 43 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045);SRVR:BN3NAM04HT129; x-ms-traffictypediagnostic: BN3NAM04HT129: x-microsoft-antispam-message-info: WFczW+7UnoZKnMQUjEV6wY4XE2wxMu3VdgMo5BhWt/LRZRSAAX0qyqcXhUnkkx5SfJ9eZ00OaooANYiLX7pDCUfZBLz9nOqbfjh0GGQKcukVLzZkewk848dzCM0k4aZnPTpwyx59W0i/9mIS0gOeqARj5q4iS/gH9nKHAVdNHofBvoIEHey1n0UoY+Did6N3 Content-Type: multipart/alternative; boundary="_000_BYAPR08MB5014AA76F28F617E4B5FC49EAC330BYAPR08MB5014namp_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 5878711b-87a9-4394-e011-08d6d49e4290 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 May 2019 16:49:10.5486 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3NAM04HT129 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_BYAPR08MB5014AA76F28F617E4B5FC49EAC330BYAPR08MB5014namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Alan, thanks for your reply. So, we currently have this situation: /dev/sda1 2.7T 2.4T 298G 90% /data/vol1 /dev/sdb2 2.7T 2.4T 296G 89% /data/vol2 /dev/mapper/vg00-data 16T 16T 373G 98% /data/vol3 postgres=3D# SELECT * FROM pg_tablespace; spcname | spcowner | spclocation | spcacl ------------+----------+-------------+----------------------------------- pg_default | 10 | | pg_global | 10 | | vol1 | 10 | /data/vol1 | {postgres=3DC/postgres,=3DC/postgres= } vol2 | 10 | /data/vol2 | {postgres=3DC/postgres,=3DC/postgres= } vol3 | 10 | /data/vol3 | {postgres=3DC/postgres,=3DC/postgres= } (5 rows) And we added new volume yday: /dev/mapper/vg00-vol4 4.0T 195M 3.8T 1% /data/vol4 So, if I understood you correctly, it is better to extend vol3 instead of c= reating new tablespace on vol4 (if possible). If not, then what is my best bet? Thanks, Julie ________________________________ From: Alan Hodgson Sent: Thursday, May 9, 2019 9:15 AM To: Julie Nishimura; pgsql-general Subject: Re: running out of disk space On Thu, 2019-05-09 at 15:46 +0000, Julie Nishimura wrote: hello, We are running out of disk space, and we introduced new volume to it. I am = about to create new tablespace X and alter user databases to set to this ne= w tablespace X. So, all new tables will be created in X, but what about exi= sting tables on previous volume? Its data will be split between 2 tbspaces? Please clarify. Thank you! Tables and indexes can only be on one tablespace. You'll need to individual= ly move them with alter table and alter index. They will be locked while be= ing moved. You should experiment with this on a test server to learn how it= works. However, unless your new volume has different I/O characteristics than the = existing volume you really shouldn't use tablespaces. You should use your O= S volume manager and filesystem tools to extend the data volume and filesys= tem into the new space. This will be much easier to manage. I'm sure your s= ystem administrator can assist you with this. --_000_BYAPR08MB5014AA76F28F617E4B5FC49EAC330BYAPR08MB5014namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Alan, thanks for your reply.

So, we currently have this situation:

/dev/sda1             2.7T  2.4T &= nbsp;298G  90% /data/vol1
/dev/sdb2             2.7T  2.4T &n= bsp;296G  89% /data/vol2
/dev/mapper/vg00-data
                   =    16T   16T  373G  98% /data/vol3

postgres=3D# SELECT * FROM pg_tablespace;
  spcname   | spcowner | spclocation |       =        spcacl            =  
------------+----------+-------------+--------------------= ---------------
 pg_default |       10 |       &nbs= p;     |
 pg_global  |       10 |      =       |
 vol1       |       10 | /data/vol1=  | {postgres=3DC/postgres,=3DC/postgres}
 vol2       |       10 | /data/vol2=  | {postgres=3DC/postgres,=3DC/postgres}
 vol3       |       10 | /data/vol3=  | {postgres=3DC/postgres,=3DC/postgres}
(5 rows)


And we added new volume yday:
/dev/mapper/vg00-vol4
                 =     4.0T  195M  3.8T   1% /data/vol4

So, if I understood you correctly, it is better to extend vol3 = instead of creating new tablespace on vol4 (if possible).
If not, then what is my best bet?

Thanks,
Julie




From: Alan Hodgson <ah= odgson@lists.simkin.ca>
Sent: Thursday, May 9, 2019 9:15 AM
To: Julie Nishimura; pgsql-general
Subject: Re: running out of disk space
 
On Thu, 2019-05-09 at 15:46 +0000, Julie Nishimura wrote:
hello,
We are running out of disk space, and we introduced new volume to it. I am = about to create new tablespace X and alter user databases to set to this ne= w tablespace X. So, all new tables will be created in X, but what about exi= sting tables on previous volume? Its data will be split between 2 tbspaces?

Please clarify. Thank you!

Tables and indexes can only be on one tablespace. You'll need to indiv= idually move them with alter table and alter index. They will be locked whi= le being moved. You should experiment with this on a test server to learn h= ow it works.

However, unless your new volume has different I/O characteristics than= the existing volume you really shouldn't use tablespaces. You should use y= our OS volume manager and filesystem tools to extend the data volume and fi= lesystem into the new space. This will be much easier to manage. I'm sure your system administrator can assi= st you with this.
--_000_BYAPR08MB5014AA76F28F617E4B5FC49EAC330BYAPR08MB5014namp_--