Simplified steps to add a second hard drive to a Debian server running Proxmox.
Firstly physically install the Hard Drive in the server chassis.
Startup the server and run the following from commandline to find the device name for the disk:
fdisk -l
This should return something similar to this:
Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 2517 20217771 83 Linux /dev/sda2 2518 2610 747022+ 5 Extended /dev/sda5 2518 2610 746991 82 Linux swap / Solaris Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table
If it is the first new disk you have added it will more than likely be /dev/sdb as the device name.
Now we partition the disk:
cfdisk /dev/sdb
Select the following options:
- New > Primary > Enter (use the size in MB already specified)
- Write
- Quit
Now we format the disk to the ext3 filesystem:
mkfs.ext3 /dev/sdb1
Mount the drive to a new folder:
mkdir /mnt/backups mount -t ext3 /dev/sdb1 /mnt/backups
Lastly we add the disk to /etc/fstab so it auto-mounts when we reboot the machine:
/dev/sdb1 /mnt/backups ext3 defaults,errors=remount-ro 0 1
That’s your drive mounted and ready to be added as backup storage in Proxmox.
To test: reboot the machine and confirm that the drive is still mounted.
great step by step for proxmox….do more like that, if you can do a spice tutorial ?
Hi, I have a problem when I attempt to follow your guide. By the part I try to format the disk to ext3 it gives me this error:
/dev/sdb1 es apparently in use by the system; will not make a filesystem here!.
And that’s actually new, but before I could do that step but by the time I got to the last one, I wrote the command which makes the disk boot everytime I turn on the server and it gave me “Permission denied” as an answer.
Hope you get to read this, even though this guide is like from ages ago.
Greetings!
Hi Carlos,
Can you paste the output from the command “fdisk -l” on here please? What size is the new harddrive you are trying to mount?
Thanks, Matt
exellent tuto
thank you
but i m error in final task
/dev/sda1 /mnt/backups ext3 defaults,errors=remount-ro 0 1
-bash: /dev/sda1: Permission denied
Hi Karis,
If you run the command with ‘sudo’ does it fix your issue?
Matt