linux system both on /dev/sda and /dev/sdb

I've got several new servers and the guy from computer shop kindly installed the ubuntu 16.04 on the servers, however, I found that one of the servers had weird partition as below.

$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 32G 4.0K 32G 1% /dev
tmpfs 6.3G 2.0M 6.3G 1% /run
/dev/sdb1 1.8T 273G 1.4T 17% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 32G 0 32G 0% /run/shm
none 100M 0 100M 0% /run/user

and

$ fdisk -l
Disk /dev/sda: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 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: 0x2367df07 Device Boot Start End Blocks Id System
/dev/sda1 * 2048 366137343 183067648 83 Linux
/dev/sda2 366139390 500117503 66989057 5 Extended
/dev/sda5 366139392 500117503 66989056 82 Linux swap / Solaris
Disk /dev/sdb: 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 / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x3bb8f201 Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 3773046783 1886522368 83 Linux
/dev/sdb2 3773048830 3907028991 66990081 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sdb5 3773048832 3907028991 66990080 82 Linux swap / Solaris

Other servers have the partitions of linux systems only on /dev/sda which is SSD, however, this one seems that linux is mounted on /dev/sdb but there're also partitions with linux system on /dev/sda.

What I want to do is mounting linux systems just on /dev/sda and using /dev/sdb as just for saving data or other backup files.

How can I fix it?

2 Answers

You've got two disk on your server, and the Ubuntu has been installed on the first partition of the second disk: /dev/sdb1.

The word "Linux" which you see in front of /dev/sda1 is just the type of partition:

/dev/sda1 * 2048 366137343 183067648 83 ***Linux***

It doesn't have anything to do with which type of operating system has been installed on that specific partition, it might be empty or even haven't been formatted at all.

What I can suggest is to use a tool like rsync to move (clone) your root file system on /dev/sda1, there are different guide to do this:

Easiest way to move a Linux setup to another partition?
how to copy entire linux root filesystem to new hard drive on with ssh and tar
How to move Linux to another partition?

If the system hasn't been used much (that is, doesn't yet have much in the way of a customized configuration or user data on it), re-installing may be the easiest way to fix the problem. Moving the installation, as Ravexina suggests, is likely to be trickier for a newbie than re-installing; but it's probably the better option if you've already invested time in customizing the installation or if you've already stored lots of data on the system.

Be aware, too, that if your /dev/sda is an SSD and /dev/sdb is a regular hard disk, there are numerous strategies and techniques for using the two together to customize performance. Which of these strategies and techniques is best depends on how you intend to use the server. The simplest is just to mount a partition from /dev/sdb somewhere and store files there that don't need the best speed, leaving the main OS installation and smaller number or size of files that do need extreme speed on the /dev/sda SSD. You might also look into bcache, which is a way to use the SSD as, essentially, a huge cache for the hard disk. This results in performance that approaches SSD levels for the entire hard disk. Bcache is harder to set up, though.

Given the mixup on the server you've written about, you may want to check the configuration of the first server to see how it's set up, both to be sure that your big hard disk is accessible and that it's configured in a sensible way for you.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like