Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Rep:
Move an existing partition to a new hard drive?
Hello everyone,
My current /usr partition is begining to fill up, and I want to move it to my second hard drive. What is the easiest non-destuctive way to do this. I have discovered that I can't have 2 partitions both named /usr, and so am getting out of my depth here.
2.
do a cp -a from the existing /usr to the new partition;
3.
amend my /etc/fstab to point to the new partition;
4.
if you've labeled the partitions may cause a problem all my partitions are unlabeled so I use /etc/fstab to ecxplicitly point to the appropriate directories;
1) Use cfdisk to create the partition in the new disk (call it emmmmm.... /dev/hd??)
2) mkfs.ext3 /dev/hd?? to create a ext3 file system in the new partition (you can use ext2, reiserfs... of course).
3) mkdir a new directory in your system... call it emmm... /usr_new
5) mount -t ext3 /dev/hd?? /usr_new
4) cd /usr && tar cvf /usr_new/usr_new.tar * (with tar you keep the symbolic links)
5) cd /usr_new && tar xvf usr_new.tar && rm usr_new.tar
6) vi /etc/fstab and change the line with /usr bla,bla,bla with /usr /dev/hd??.
7) reboot
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
OK, aikempshall I intend to give that a go. I take it then that if I wanted to do the same with say my /home partition, I just follow the same procedure.(using the correct names of course).
Could I then, ask you a second question? If I were to carry this out succesfully, then resize my now defunct partitions, and then transfer back again. Am I able then to keep my partitions as they are?
And could ypou please explain about the reference you made to labeling.
Thanks.
The steps outlined by Goala is the standard textbook approach. Where I've departed from this approach is to use "cp -a" instead of tar.
Yes to your second question. What you appear to intend to do is to use the new partition as effectively a temporary back up device whilst insreasing the size of the existing partition.
In cfdisk you can assign a label to a partition and use that label in fstab to mount the partition. Some time ago I spent a little time trying to work out why my system wouldn't boot cleanly after moving partitions around following my ditching of redhat and fedora. I removed the label via cfdisk and haven't looked back since. Labeling of partitions probally makes life a little easier in a large installation where life is organised.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
Thanks to everyone who helped me out with this problem. After following the suggestions outlined, I have successfully managed the task, and learned a bit more at the same time.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
Thanks goala, but here's another quick question for you. Everything appears OK. CFDISK shows my new partitions at the right sizes, as does qtparted, fdisk,lsparts and diskdrake, but the command df shows the partition /dev/hda1 as only being 738Mb when it's 3.9Gb (as shown by cfdisk).
Any idea what might have caused this?
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
Solved,
Turns out that the resizing script in Mandy is flawed, and it doesn't run the resize_reiserfs command. Ran that command, gave it the partition size, even though the doc's say it doesn't need it to grow, and df now reads space correctly.
All of the above incidentally done under pclinux2k4 live CD, as it's the closest next distro to mandy, and therefore very familiar to use.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.