-2

I am using Ubuntu server 10 for LAMP and hosting sites.

I installed the server without a GUI, and what I want to do is to add a second HDD for some backup.

I attached the HDD but the problem is I don't know now how to mount it without a GUI.

Vasili Syrakis
  • 4,558
  • 3
  • 22
  • 30

3 Answers3

1
  • Use fdisk to partition the drive.
  • use mkfs to create a filesystem.
  • use mount to mount it.
user9517
  • 115,471
  • 20
  • 215
  • 297
1
  1. dmesg | grep sd[a,b,c,d,e] or dmesg | grep hd[a,b,c,d,e] 90% it will be sdb or hdb
  2. you need to make file ssystem on it, mkfs.ext4 /dev/sdb for example or use xfs
  3. mkdir /backup; mount /dev/sdb /backup
  4. df -h
  5. add your new drive to /etc/fstab in order to automount: blkid | grep /dev/sdb or /dev/hdb and add the following line to /etc/fstab
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
UUID=80d1d2d5-610d-48ce-8263-c749252eca66   /backup xfs   defaults    0    0

done

:~$ dmesg | grep sd[a,b,c,d,e]

[ 0.873576] sd 2:0:0:0: [sda] Attached SCSI disk [ 6.645849] EXT4-fs (sda1): INFO: recovery required on readonly filesystem [ 6.645853] EXT4-fs (sda1): write access will be enabled during recovery [ 8.853977] EXT4-fs (sda1): recovery complete [ 8.859269] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) [ 21.446754] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro

Ilja
  • 452
  • 2
  • 9
1

First, you need to see which device is the hard drive you have connected. You can do that with the following command:

# fdisk -l

I don't know how many disks you have or how your disks are divided.

I suppose you have a disk with two partitions. Maybe you'll see something like this in result of fdisk -l command:

/dev/sda1 and /dev/sda2.

If you connect an another disk, you will see a /dev/sdbX the result of fdisk -l command. If this disk is empty, you can use the "cfdisk" to format and make a new partition. Click here to learn how use "cfdisk"

At the end, use the mount command to manage the data on your disk.

Example:

 # mkdir /mnt/mydisk (create a folder to access the data on your disk)
 # mount /dev/sdb1 /mnt/mydisk 

Regards.