Home > backup, filesystem > Prepare New Partition Linux

Prepare New Partition Linux

I just got a new HD on my server so, I will use it to backup data, so lets get it ready:

First let’s check the status:

fdisk -l /dev/sdb

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Ok, I can see the disk so let’s create a primary partition of 144Gb (454656 Mb), I’m using this size because its the size of my current / partition and I might use this later on. So:

fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1):<enter>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): +454656M

Command (m for help): p

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 55276 444004438+ 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Ok, the partition is ready to be formated:

mkfs.ext3 /dev/sdb1

Add the label: ‘/primarybackup’ to my just created partition and create the directory:

tune2fs -L/primarybackup /dev/sdb1

mkdir /primarybackup

Now add this line to /etc/fstab:

LABEL=/primarybackup    /primarybackup          ext3    defaults        0 0

Not lets mount it:

mount /primarybackup

Done, now you can write on /primarybackup

Advertisements
Categories: backup, filesystem Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: