SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-01-19 17:24:53

dhave
Member
Registered: 2012-11-05
Posts: 24

Swapping hard drives (a brainteaser)

I have a Thinkpad T420. Crunchbang is currently installed on a 120Gb secondary hard drive in the Ultrabay. Arch Linux, which I still like very much and often use, is installed on the 500Gb internal hard drive. I usually boot into Crunchbang, but several times a week I still boot into Arch, which I like to keep current.

I'd like to swap, putting Crunchbang on the larger, internal drive and Arch on the smaller, secondary drive.

Many times I've migrated to a new hard drive just by doing a partition-by-partition copy from the old drive to the new one. In this case, though, I want to exchange locations of Crunchbang and Arch.

Does anyone see a way to do this without copying both installations to a third drive temporarily? I suppose I could scavenge a couple of unused 3.5" drives for this purpose, but it would be a hassle.

I don't want to reinstall either distro from scratch, by the way. I really want to swap without having to reinstall and reconfigure.

Thanks!

Last edited by dhave (2013-01-19 17:37:38)

Offline

Help fund CrunchBang, donate to the project!

#2 2013-01-19 18:03:24

zalew
#! Junkie
From: Warsaw, .PL
Registered: 2012-03-28
Posts: 374

Re: Swapping hard drives (a brainteaser)

I guess the 500gb isn't filled up. so, unless you partitioned it physically instead of logically, you can shrink the current arch partition and make a second physical one, dd cb in there, then dd arch where cb was, then remove the old arch partition and move the one with cb closer? just thinking loudly...

Offline

#3 2013-01-19 19:46:01

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 10,163
Website

Re: Swapping hard drives (a brainteaser)

Use fsarchiver to backup and restore ...

Here is a how to


VSIDO | SolusOS

Words That Build Or Destroy

Offline

#4 2013-01-19 21:03:51

JLloyd13
#! Member
Registered: 2012-08-08
Posts: 83

Re: Swapping hard drives (a brainteaser)

http://www.overclock.net/a/howto-moving … ng-gparted

created by me on a different forum

Offline

#5 2013-01-21 20:06:37

dhave
Member
Registered: 2012-11-05
Posts: 24

Re: Swapping hard drives (a brainteaser)

Thanks, zalew, VastOne and JLloyd13. I used info from each of your solutions to solve my problem.

(1) I attached a usb optical drive and booted a recent version of System Rescue CD. I launched System Rescue's graphical interface, which is Xfce.

(2) In System Rescue, I used gparted to shrink my Arch /home partition to free up space on the 500Gb drive.

(3) Also using gparted, I copied over my CrunchBang partitions from the 120Gb drive to the now-unallocated free space on the 500Gb. 

(4) After shutting down, I removed the 120Gb drive from the ultrabay, leaving only the 500Gb drive installed.

I was very pleased to see that the uuid of my CrunchBang partitions remained the same after they were copied. Since I have grub2 set up on the 500Gb drive to see uuids rather than relative sdX designations, I didn't even have to change my grub.cfg to be able to boot right back into CrunchBang after removing the 120Gb.

In another session, I used gparted on SystemRescue to expand my CrunchBang partitions to fill the remaining space on my 500Gb drive, giving me a little more space for the time being. Again, I was pleased to see that the uuids remained unchanged even after increasing the size of my CrunchBang partitions. I wasn't sure this would be the case.

Later, I'll likely move Arch to the 120Gb drive and devote the entire 500Gb drive to CrunchBang. 

Thanks again for the helpful suggestions.

Offline

#6 2013-01-21 21:26:49

JLloyd13
#! Member
Registered: 2012-08-08
Posts: 83

Re: Swapping hard drives (a brainteaser)

dhave wrote:

Thanks, zalew, VastOne and JLloyd13. I used info from each of your solutions to solve my problem.

(1) I attached a usb optical drive and booted a recent version of System Rescue CD. I launched System Rescue's graphical interface, which is Xfce.

(2) In System Rescue, I used gparted to shrink my Arch /home partition to free up space on the 500Gb drive.

(3) Also using gparted, I copied over my CrunchBang partitions from the 120Gb drive to the now-unallocated free space on the 500Gb. 

(4) After shutting down, I removed the 120Gb drive from the ultrabay, leaving only the 500Gb drive installed.

I was very pleased to see that the uuid of my CrunchBang partitions remained the same after they were copied. Since I have grub2 set up on the 500Gb drive to see uuids rather than relative sdX designations, I didn't even have to change my grub.cfg to be able to boot right back into CrunchBang after removing the 120Gb.

In another session, I used gparted on SystemRescue to expand my CrunchBang partitions to fill the remaining space on my 500Gb drive, giving me a little more space for the time being. Again, I was pleased to see that the uuids remained unchanged even after increasing the size of my CrunchBang partitions. I wasn't sure this would be the case.

Later, I'll likely move Arch to the 120Gb drive and devote the entire 500Gb drive to CrunchBang. 

Thanks again for the helpful suggestions.

why not use a shared /home?

at the moment my /boot, /home, and swap are shared between LMDE squeeze and freebsd (mounted as ext4 in linux and ext2 in freebsd)

Last edited by JLloyd13 (2013-01-21 21:27:51)

Offline

#7 2013-01-21 21:34:36

dhave
Member
Registered: 2012-11-05
Posts: 24

Re: Swapping hard drives (a brainteaser)

JLloyd13 wrote:

why not use a shared /home?

Well, as I grow older, I suspect my kids will put me in some kind of group home some day, but, for the time being, my wife and I want to try to live independently. (I'm almost certain I'm one of the oldest people around here.)

JLloyd13 wrote:

at the moment my /boot, /home, and swap are shared between LMDE squeeze and freebsd (mounted as ext4 in linux and ext2 in freebsd)

Oh, so that's what you mean!  tongue

Actually, that's a really interesting suggestion and one that hadn't occurred to me. I'll probably end up breaking something, but that's what makes Linux fun, right? I'll give it a try.

Thanks.

Last edited by dhave (2013-01-21 21:40:03)

Offline

#8 2013-01-21 21:52:42

zalew
#! Junkie
From: Warsaw, .PL
Registered: 2012-03-28
Posts: 374

Re: Swapping hard drives (a brainteaser)

cool. now I noticed I said 'dd' when talking about partitions not disks.

I tried a shared home once ago between debian xfce and xubuntu (or was it lxde and lubuntu?) - configs borkage.

Offline

#9 2013-01-21 22:32:57

dhave
Member
Registered: 2012-11-05
Posts: 24

Re: Swapping hard drives (a brainteaser)

zalew wrote:

cool. now I noticed I said 'dd' when talking about partitions not disks.

Yeah, I got that. As it turned out, I took the lazy way and used gparted to copy the partitions. I had used parted and gparted often to create, delete or resize partitions, but I'd never done a partition copy. It worked really well.

zalew wrote:

I tried a shared home once ago between debian xfce and xubuntu (or was it lxde and lubuntu?) - configs borkage.

Your warning is appreciated. I'll probably goof something up when I try it, but that's the way I normally learn. I figure if JLloyd13 is managing to share home, swap and even boot partitions between Linux and FreeBSD, it should be workable between Arch and CrunchBang.

I'm not going to share boot, though. That's seems a bridge too far, especially since I've got a pretty strange boot setup: uefi booting directly to the Arch kernel (renamed with an efi suffix), but via grub for CrunchBang, all facilitated by rEFInd. I haven't taken the time to experiment with direct efi booting of CrunchBang, because I believe the 3.2 kernel doesn't include efi boot stub support, and I've been too lazy to upgrade the CrunchBang kernel. My Arch kernel is 3.7.3 (which is one thing I like about Arch -- hot fresh kernels on a frequent basis).

Last edited by dhave (2013-01-21 22:46:00)

Offline

#10 2013-01-22 01:42:19

Richard
Member
From: Venezuela
Registered: 2011-07-17
Posts: 37

Re: Swapping hard drives (a brainteaser)

The only safe way I know to retain home is to have multiple users in a separate  /home/*  or  ~/* 
and separate users, such as:  ~/dhave.cb , ~/dhave.arch , ~/dhave.lubu , ~/dhave.lmdex , etc.

Personally, I have better luck with a separate /DATA partition and keep home on the / of each install.
This avoids breakage between distros and I only need to mount the /DATA partition at boot, via fstab.

Only thing that gives trouble is the clock. Even though I set the hardware clock to local time
it doesn't always seem to work keep correct time.

Last edited by Richard (2013-01-22 01:52:32)


Manjaro Xfce4.11
#! Waldorf Xfce4.8

Offline

#11 2013-01-22 03:06:39

JLloyd13
#! Member
Registered: 2012-08-08
Posts: 83

Re: Swapping hard drives (a brainteaser)

as above my users are named JLloyd13 and JLloyd135 I then ln -s my personal folders (videos, pictures, etc. ) to the other. as for the same /boot it does make some extra grub menu entry’s  (when I was using arch the default option was debian squeeze with kernel 3.6!) but overall no problems. in fact, debian worked fine with the 3.6 kernel, and arch did with the 2.6.32 kernel.  I prefer keeping /boot off / because then I can reinstall over it without formatting and keep any custom kernels and what not. This lets all distros (while, except freebsd, as it can't really use linux kernels!) have access to all those.

Offline

#12 2013-01-22 20:29:09

dhave
Member
Registered: 2012-11-05
Posts: 24

Re: Swapping hard drives (a brainteaser)

Thanks for elaborating, JLloyd13(5).

I'm seeing that sharing pure data files -- docs, music, videos and such -- makes a lot of sense. I'm thinking I probably won't experiment with sharing /home. I do use different usernames for Arch and for CrunchBang, so I imagine I could keep things straight as far as user-specific onfig files go, but maybe the benefit isn't worth the risk.

What I've always done in the past, and will continue to do, is to just mount the other distro's partitions on an as-need basis. I do this from time to time when I want to consult files in the other distro's /etc or /home directories.

Offline

#13 2013-01-24 20:43:58

lupinehorror
Member
From: alba
Registered: 2012-10-21
Posts: 12
Website

Re: Swapping hard drives (a brainteaser)

i'd recommend not sharing /home
it can lead to all manner of config issues and GUI strangeness (at least in my case...it might be different for others).
even having a persistent /home partition (as i always do) can make switching between some distros difficult.


you know it's love when you memorise her IP address to save DNS overhead

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo