Enable New volume on Linux

Here one step by step to add a new disk(1tb)/partition to linux(mint/ubuntu) and enable it.

  1. Add a new partition.
  2. Format the new partition.
  3. Mount the new partition.

1.Add a new partition

The status of new disk d be unpartited DOS, we’d check currently partition status.

1
sudo df -h
1
2
3
4
5
6
7
8
9
10
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 797M 9.4M 788M 2% /run
/dev/sda2 102G 7.5G 90G 8% /
tmpfs 3.9G 165M 3.8G 5% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 511M 53M 459M 11% /boot/efi
cgmfs 100K 0 100K 0% /run/cgmanager/fs
tmpfs 797M 52K 797M 1% /run/user/1000

we can’t see the 1Tb disk in this output, so we can check the disk number.

1
sudo ls /dev/[sh]d*
1
/dev/sda /dev/sda1 /dev/sda2  /dev/sda3 /dev/sdb

Obviously, the disk should be /dev/sdb, let’s add a new partition.

1
sudo fdisk /dev/sdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-xxxxx, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-xxxxx, default xxxxx):
Using default value xxxxx
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

we’d see a new part

1
sudo fdisk -l /dev/sdb
1
2
3
4
5
6
7
8
Disk /dev/sdc: xxxxxxx GB, xxxxxxxxx bytes
255 heads, 63 sectors/track, xxxxx cylinders
Units = cylinders of xxxx * xxx = xxxxxxx bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x40bab849
Device Boot Start End Blocks Id System
/dev/sdb1 1 xxxxxx xxxxxxxxxx xx Linux

2.Format the new partition

1
mkfs -t ext4 /dev/sdb1

3.Mount the new partition

we’d know uuid of new partition.

1
sudo blkid
1
2
3
4
/dev/sda1: UUID="AF74-BFC2" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="fdf6b94e-f64d-48ae-955d-823b43da17d8"
/dev/sda2: UUID="b0a34b35-689e-488a-9552-8c98748dc670" TYPE="ext4" PARTUUID="1d7266ac-1e53-41bf-81f5-b40b10e87e11"
/dev/sda3: UUID="9c1bfe17-d560-43ac-aa22-7c2da98f1aff" TYPE="swap" PARTUUID="34966359-bab1-4746-8420-74f6dc43742a"
/dev/sdb1: UUID="c2347dae-93f2-4a83-894e-4e69b622f3f3" TYPE="ext4" PARTUUID="c2851069-01"

sdb1‘s uuid is c2347xxxxxxxxxx, we should echo it to /etc/fstab

1
UUID=c2347xxxxxxxxxxxxxxx /data1 ext4 defaults 0 0
1
mount /data1

now it mountted to /data1

Tips:

For the permission limited:

1
sudo chmod ugo+wx /data1

Relogin needed perhaps.

#
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×