LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-26-2013, 08:45 PM   #1
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 22.04
Posts: 199

Rep: Reputation: 33
How to resize the partition?


Hello folks,

I use an old 80G HDD(/dev/sdb1) as following:
Code:
# mkfs.ext3 /dev/sdb1
# mount /dev/sdb1 /mnt/c

Now I installed another 2T SATA HDD(/dev/sdc), and I want '/mnt/c' would contains /dev/sdb1 and /dev/sdc. I dont want to remove the data of former /dev/sdb1, is there any method to do this?

Thanks,

Phillip
 
Old 04-26-2013, 11:28 PM   #2
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
The simple answer is no. You cannot easily combine a large second hard disk with a smaller existing formatted hard disk.

You can do something like this.

Code:
mount /dev/sdb1 /mnt/c
mount /dev/sdc1 /mnt/c/largedisk
Or you can do this.

Code:
mount /dev/sdc1 /mnt/c
mount /dev/sdb1 /mnt/c/smalldisk
You can also make any folders of the large disk appear on the small disk like this.

Code:
mount /dev/sdb1 /mnt/c
mount /dev/sdc1 /mnt/d
mount --bind /mnt/d/afolder /mnt/c/afolder
mount --bind /mnt/d/folder1 /mnt/c/folder2/folder3
In the above example, the folder "/mnt/c/afolder" will actually store files in the folder "afolder" on "/dev/sdc1". The folder "/mnt/c/folder2/folder3" will actually store files in the folder "folder1" on "/dev/sdc1". The problem with this approach is that you have to add these "bind" mounts in the "/etc/fstab" file or type the commands in after every boot.

If you are willing to reformat /dev/sdb1 and /dev/scd1 then you can use the Logical Volume Manager to combine the two disks and make them appear as one larger disk. I don't recommend doing that because it makes data recovery difficult if one of the drives fails.

You are better off to just copy the data from the smaller drive to the larger drive and re-use the smaller drive.

Code:
mount /dev/sdc1 /mnt/c
mount /dev/sdb1 /mnt/hd
cp -a /mnt/hd/* /mnt/c
umount /mnt/hd
That will give you a larger "/mnt/c" file-system. You can reformat the 80G HDD after copying the files to the larger disk.

The "mount" command can mount a hard disk or folder anywhere, not just under the "/mnt" directory. You have to create an empty directory (mount point) ahead of time.

Code:
mkdir /mydisk
mount /dev/sdc1 /mydisk
mkdir /home/phillip/smalldisk
mount /dev/sdb1 /home/phillip/smalldisk
Usually you want to add these kinds of mounted disks to "/etc/fstab" so that they are always mounted on boot. The "/mnt" directory is usually for temporarily mounted file-systems.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to Resize NTFS partition with 4 different partition editors Alexandrian Linux - Newbie 11 05-19-2006 06:09 PM
Disk Partition Resize Trouble and Partition Questions GNewbie Linux - Newbie 2 11-15-2005 04:15 PM
How to resize a partition and create/mount a new partition? Maarten_Holland Linux - Newbie 1 04-20-2005 08:56 AM
Partition Out Of Space? How to resize from another partition? colelinux Linux - Newbie 6 03-16-2004 08:48 AM
resize an ext3 partition with coexisting ntfs partition andy_g Linux - Newbie 1 02-03-2004 05:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration