1

I have read a lot of articles about that, but I'm not sure about the results...

On my dedicated server (debian), I have the following :

Sys. fich.     Taille Util. Dispo Uti% Monté sur
rootfs            20G  1,4G   17G   8% /
/dev/root         20G  1,4G   17G   8% /
devtmpfs         7,8G     0  7,8G   0% /dev
tmpfs            1,6G  244K  1,6G   1% /run
tmpfs            5,0M     0  5,0M   0% /run/lock
tmpfs            3,3G  4,0K  3,3G   1% /dev/shm
/dev/sda3        1,4T  866G  468G  65% /home
/dev/sda5        481G  4,9G  452G   2% /var

What I would like to do is to allocate 400G (for example) of the /dev/sda5 partition to the /dev/sda3 partition. (/var to /home)

So I would like to know if I can follow these instructions (or this one) or if I have to do otherwise to avoid losing any data. Or if it's just impossible.

EDIT (fdisk -l output) :

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


Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 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/sda1               1  3907029167  1953514583+  ee  GPT

EDIT 2 (parted output) :

Model: ATA HGST HUS724020AL (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name     Flags
 1      20,5kB  1049kB  1029kB                  primary  bios_grub
 2      2097kB  21,0GB  21,0GB  ext4            primary
 3      21,0GB  1476GB  1455GB  ext4            primary
 4      1476GB  1476GB  536MB   linux-swap(v1)  primary
 5      1476GB  2000GB  524GB   ext4            primary
Maxime Lafarie
  • 111
  • 1
  • 5
  • 1
    I watch your link, your disk isn't LVM. You can resize with `parted`. – PersianGulf May 02 '16 at 12:48
  • Thanks PersianGulf, is there anywhere where steps are well explained? I tried to understand the 'resize' command of parted, but I'm not sure... Do I have to begin with the /var partition ? Maybe [this is a clue](https://thewiringcloset.wordpress.com/2013/01/09/extending-a-root-filesystem-in-linux-without-lvm/)..? – Maxime Lafarie May 02 '16 at 13:48
  • Just edit previous post with fdisk -l output, maybe it helps... – Maxime Lafarie May 02 '16 at 14:05
  • Given that the disk appears to be GPT, the output from gdisk or parted would be more useful. Also please tell us exactly which filesystem(s) you wish to shrink or expand. – fpmurphy May 02 '16 at 14:31
  • I add parted output, fpmurphy1. What I want is to give 400GB of the `/var` partition to the `/home` partition. Thank you for your reply, if you need more information please ask me. – Maxime Lafarie May 02 '16 at 15:14

1 Answers1

2

You can use gparted, but there is a chance to lose data .So make a backup before.

LXGA
  • 312
  • 1
  • 3
  • 13