You are not logged in.
rsync is different, in that you have to create the filesystem on the target partition before launching the rsync command.
In your case, since the partition /dev/sda2 already exists, all you need to do is
TARGETDEVICE="/dev/sda2"
TARGETMOUNT="/media/sda2"
sudo mkdir -p /$TARGETMOUNT
sudo mount $TARGETDEVICE $TARGETMOUNT
sudo mkfs.ext4 $TARGETDEVICE
sudo rsync -aAzrHxXv / ${TARGETMOUNT}/
sudo umount $TARGETMOUNT
sudo update-grubreboot and you should have entries in your grub menu to boot from sda2.
Edit: No need to delete the partition. mkfs.ext4 will create a new filesystem on it, and it will get a new UUID by the same command.
hth
Last edited by xaos52 (2011-11-17 22:22:27)
bootinfoscript - emacs primer - I ♥ #!
Online
All right dubois
All done with dd and am now posting from my duplicate root partition and here are the steps I took
Booted to a livecd session .. I use systemrescue for my livecd
dd if=/dev/sda3 of=/dev/sda7 bs=512booted back to original fs
ran the following
sudo tune2fs -U random /dev/sda7sudo e2fsck -f /dev/sda7
sudo resize2fs /dev/sda7those two were needed because I dd'd to a partition that was larger and these resized it
ran
sudo blkid to get the new uuid on sda7
change fstab to reflect the correct uuid for /
# / was on /dev/sda3 during installation
UUID=e644e49d-f08b-4aff-9971-8b4d6dd47bfc / ext4 errors=remount-ro 0 1Added the following to
/etc/grub.d/40_custom
menuentry "Sid on sda7" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet
initrd /initrd.img
}This edit is done and adds a grub entry so that you do not have to worry about grub.cfg changing on you .. the method advised in grub2
ran
sudo update-gruband everything works perfectly
It is my best guess that something bad happened during your dd copy
Last edited by VastOne (2011-11-18 01:25:51)
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
@dubois
You have stated that all the chatter in this thread is a good thing and I suppose from a social standpoint that is true but from the standpoint of productive help, not so much. Everyone always wants to promote their favorite method but that has actually been distracting in this thread, I was guilty of it too because I thought rsync was a better choice for what you wanted to do. It would be better for you to concentrate on one method, then try another method if you want to expand your "howto". Either of the cloning methods currently being considered could work, and the method of archiving then restoring could also work. There is nothing wrong with the theory to this point.
One thing that will serve you well as you progress through your experiment with the unstable branch is to pay attention to the error messages the system gives you.
For example:
fsck from util-linux-ng 2.17.2
WARNING: bad format on line 16 of /etc/fstab
Now, looking at your fstab, it looks to me like line 16 is blank, however, I notice you have an SD card, is it really formatted as ext4? I would want to get to the bottom of that error if I got that message on my system.
In addition, you could comment out that, "/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto", line, it is a leftover from when you installed from USB.
BTW gparted still sees these partitions as being identical and both mounted on / despite fstab...
That indicates that you booted to one of your installs (partitions) but had a line in fstab (on that partition) that refers to the other install's "/" (the other partitions root), thus when the system gets to the point in the boot where it mounts the volumes in the static filesystem table, it creates a problem because the first thing it does is mount the "second" "/" over top of the first (the one that was booted first). As you can imagine that can't be good and that's why gparted saw it that way (just like the system told you).
It might be helpful to show us the fstab from both sda1 and sda2 and the result of entering the command, sudo blkid -c /dev/null, so we can verify that you have the correct fstab entries corresponding to the correct partition.
Last edited by Thorny (2011-11-18 12:34:25)
Offline
Thorny if you ask one question on a Linux Help Forum you'll get one hundred and one answers in return and I know that. It used to aggravate me to no end when every son and his brother would chime in, often will irrelevancies, but I've learned to filter that out for the most part. I appreciate your thought or concern and we can both hope that someone else reads this in the future and stays quiet when it's obvious the OP is being helped, especially if that help is direct, to the point and from someone competent to give it. Such was the case here. That being said, some friendly banter, especially from the forum heavyweights in the thread of an older guy who's stepping out with a bigger, faster drive able to hold multiple partitions, who's stepping out into creating what's essentially two or three of his old netbooks into one is appreciated. It shows that they notice him for what he does and not for what he says. I'm very much OK with that. 
I did check the error in fstab, it seems the computer had written something to the effect that this was an original copy. I deleted it and the error ceased.
Yes, my 8GB ADATA Class 8 SDHC is formatted as ext4 because it's a backup for my /home and tbh I've tried ext2,3,4 and this seemed to work best for me. If, otoh, you can offer me a decent argument for changing it then I'm all for listening. 
You said
That indicates that you booted to one of your installs (partitions) but had a line in fstab (on that partition) that refers to the other install's "/" (the other partitions root), thus when the system gets to the point in the boot where it mounts the volumes in the static filesystem table, it creates a problem because the first thing it does is mount the "second" "/" over top of the first (the one that was booted first). As you can imagine that can't be good and that's why gparted saw it that way (just like the system told you).
and I can sorta understand what you mean and yeah, that's the way it happened, or at least the way I remember it. But how this little sucker works inside is still a mystery to me. This excursion has been more about me and what I'm capable of doing and less about the netbook, although it's nice to know information that the one I chose to work and play with for the few years will stand up to all the stick-poking I'll be putting it through. 
EDIT -- I was just re-reading this thread and noticed that had there been no chatter in it you and machinebacon may not have hooked up like you did, so, yes, sometimes chatter is a good thing. Thanks again for your input, your insights. I hope we can talk more later. 
Last edited by dubois (2011-11-18 18:58:42)
Offline
Vast One, later this morning I intend to follow your instructions for what appears to be an excellent solution for what I'd intended to do. I also noticed a set on instructions posted by xaos52 that uses the rsync method.
At this point I ought to make a backup of my /dev/sda1 which is what I'm so keen on protecting in the first place, then proceed to making a copy to tinker with. I guess I didn't realize the length of time involved when I set out to do this...
Last edited by dubois (2011-11-18 14:37:18)
Offline
@dubois
I just wanted to do the step by step and while fresh in my mind put down how I did the dd version and confirm it worked
I had done it many times but never with #! and although I know it is generally the same across debian base, I wanted to be sure..
On my main machine I also created the same thing with fsarchiver. I am sure you saw bits of the Sid perl jam thread I had... Before I switched to Sid I had done a backup with fsarchiver of my Testing #!. Now that the perl jam is over, I restored that backup to another partition and updated to sid and a massive update with dist-upgrade just to see it from that perspective
If theres anything I offered in any of this that backup/restore methods on multiple fronts are working quite well in #!, and of course to be your personal guinea pig

VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
I'm really beginning to believe that I'm missing something essential to the OS that my untrained eye doesn't see. I can't put it into words but it's entirely possible that in deleting some of the default CB10 apps and replacing them with others of my choosing that something went missing, although deborphan says there ain't any. 
Is there some way to check my files, scripts, python or otherwise to see??
Offline
@dubois...
Relevant to getting this to work?
I am just asking, do you mean that you may have deleted something that is causing a backup/restore to fail?
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
Just an off topic note but remastersys is broken, again. On running a backup or distributable iso it returns a message one second later saying that my new ISO is located in... It isn't. If it worked like it did last year and the year before all this would be irrelevant to me today. Anyway. Maybe I'll post over there -- a quick reading through the latest posts revealed nothing.
OMG! It's all my fault!!

Offline
@dubois...
Relevant to getting this to work?
I am just asking, do you mean that you may have deleted something that is causing a backup/restore to fail?
Yes and yes. Although I couldn't say what. It's a feeling, a hunch, but this little sucker just flies, and so smoothly, too. I just don't know.
Offline
VastOne wrote:@dubois...
Relevant to getting this to work?
I am just asking, do you mean that you may have deleted something that is causing a backup/restore to fail?
Yes and yes. Although I couldn't say what. It's a feeling, a hunch, but this little sucker just flies, and so smoothly, too. I just don't know.
Tools like dd and rsync are basics that should not be affected by anything removed. If they were broken, terminal would tell you so..
Did you run dd while booted from a livecd?
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
Oh, yes. Last night and I had errors. No way to copy them but fsck failed, UUIDs not recognized, /dev/sda2 doesn't exist. You get the point. I followed your how to exactly. I had to umount my partition once or move the time I umounted it, I don't recall.
Your work has proven the point I set out to make, it's just that I'm unable to duplicate those same steps. And yes, I know that terminal would let me know of any errors. Self-doubt creeping in, no doubt. I think my brain is fatigued. 
Last edited by dubois (2011-11-18 16:59:00)
Offline
I've been reading this post http://crunchbanglinux.org/forums/post/122766/#p122766 by oupsemma who I know is a long-time poster here and elsewhere. It's in the repos and would maybe save me hassles -- need to see if I can put it on a bootable DataTraveler 4GB USB drive. 
EDIT -- I'm going to take a break from this project until after the weekend. It's not because I didn't or haven't received the best help, the most patient help -- because I have and Vast One is to be commended for his patient and persistent efforts to teach me, but because I'm becoming frustrated with my inabilities to get this to work. Sometimes a break is needed -- I'll be back at it when I feel refreshed.
If I still drank, a couple shots of straight Kentucky Bourbon with an ice water chaser would be in order. Anyone want to have a drink for me? 
EDIT -- I see that partimage is a feature on systemrescue which I installed to CD last night. Something else to play with!
EDIT -- Form the partimage site
Partimage does not support ext4 or btrfs filesystems.
Last edited by dubois (2011-12-02 21:18:37)
Offline
Rest easy amigo...
There is this too, to compliment that thread you referenced... This is on the #! wiki and is an excellent written how to, exactly as I did last night on my main machine
Backing up and restoring your root partition
FYI, I did the backup and restore using this method
But after the restore I finished it a different way than the wiki How To:
I ran the following from my original fs (sda1) which is what I backed up and restored it to sda5
sudo tune2fs -U random /dev/sda5ran
sudo blkid to get the new uuid on sda5
change /etc/fstab (on the new sda5) to reflect the correct uuid for /
# / was on /dev/sda3 during installation
UUID=e644e49d-f08b-4aff-9971-8b4d6dd47bfc / ext4 errors=remount-ro 0 1Added the following to (on original fs sda1)
/etc/grub.d/40_custom
menuentry "Sid on sda5" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet
initrd /initrd.img
}This edit is done and adds a grub entry so that you do not have to worry about grub.cfg changing on you .. the method advised in grub2
ran
sudo update-gruband everything works perfectly
Last edited by VastOne (2011-11-18 20:06:45)
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
Well, sir. I've been working on Plan B for most of this evening. I used Clonezilla to clone my /dev/sda1 to an ext4 formatted 8GB Class 6 SDHC which is /dev/sdb1 mounted at /mnt/disk. At the same time I reformatted an old 1GB Mini-SD to ext2 to be a backup for /home and it's also called /dev/sdb1 [because that's my built-in card reader slot] and mounted at /media/disk [but it's not in fstab, yet, as it auto mounts via Thunar]
I followed all the steps Vast One posted just above and everything seems to be working just fine. I'll continue to work on my original plan now that I've gotten some decent results and a confidence boost, too. 
Now, I'd like to ask a really stupid question: because both drives are identical, other than selecting this one, or that one in GRUB, how can I know for sure which drive I'm on? I tried making a change in one but it showed up in the other and I just wondered if Clonezilla somehow synced my two drives. Far-fetched, I know.
Here's some information
christopher@1015PEM:~$ blkid
/dev/sda1: UUID="6a85024c-4a08-4eff-8a5d-a3f87d6d3c6a" TYPE="ext4"
/dev/sdb1: UUID="5106f702-b8e4-4488-ae32-ced5c95290e8" TYPE="ext4" # /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda1 during installation
UUID=6a85024c-4a08-4eff-8a5d-a3f87d6d3c6a / ext4 errors=remount-ro 0 1
# /dev/sdb1 is backup copy of OS on 8 GB SDHC
UUID=5106f702-b8e4-4488-ae32-ced5c95290e8 /mnt/disk ext4 errors=remount-ro 0 1Offline
dubois - good news old boy, glad to hear..
Can you elaborate on "tried making a change in one but it showed up in the other" and let me know exactly what you did?
Thanks
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
That was a bit brief, wasn't it? 
I changed the title line of my conky on what GRUB said was /dev/sdb1 but it was also changed on what was supposed to be /dev/sda1. I don't now if I'm somehow booting into the same one or not -- GRUB thinks they're different and so does an iso of gparted. But how can I know for sure? And yeah, it's exciting.
Offline
That was a bit brief, wasn't it?
I changed the title line of my conky on what GRUB said was /dev/sdb1 but it was also changed on what was supposed to be /dev/sda1. I don't now if I'm somehow booting into the same one or not -- GRUB thinks they're different and so does an iso of gparted. But how can I know for sure? And yeah, it's exciting.
A change to .conkyrc, on your /home partition logged into as the same user, the change will be there for both... If you are logging in as the same user to both.. /home is persistent..
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
Point made. Point taken. 
Here's conky just for reference
TEXT
${font unispace:regular:bold:size=9}$alignc X F C E S Y S T E M I N F O ${font}
${alignc}Debian Squeeze 6.0.3+Statler 10
$kernel $alignr$nodename
${stippled_hr}
Uptime ${alignr -5}$uptime
${stippled_hr}
RAM $alignr$mem/$memmax
Swap $alignr none
Disk A $alignr${fs_used /}/${fs_size /}
Disk B $alignr${fs_used /mnt/disk}/${fs_size /mnt/disk}
Disk C $alignr${fs_used /media/disk}/${fs_size /media/disk}
${stippled_hr}
CPU ${alignr -5}${cpu cpu0}%
${execpi 60 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor} ${alignr -11}${freq_g 1}/${freq_g 2}GHz
Temp ${alignr 3} ${acpitemp}°C
${stippled_hr}
Batt ${alignr 4}${battery_percent BAT0}%
${font unispace:regular:bold:size=13} ${alignc} ${time %I:%M} ${font}
${alignc}${execi 30 /home/christopher/bin/weather.sh 78758}
${alignc} ${execpi 1800 gcal -H no | sed 's/^./ ${goto 45} /'} You can see my three drives, A, B, and C [the 1GB which isn't plugged in now]
Thanks for pointing out the obvious to me. It seems like sometimes I can't see what's right in front of me.
Last edited by dubois (2011-11-21 03:18:21)
Offline
Aye mate... Didn't mean to be so short with it..
To answer your question, you can always run blkid to get the uuid of what you are on..
You could also see that info from Thunar I believe. I use pcmanfm and when I hover over a partition, it shows me the uuid
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
I'm going to answer my own question:
When I rebooted into what I thought was /dev/sdb1 it was markedly slower to boot and I noticed the script [no splash or logo screens so I can see what's going on inside -- need to learn to read faster, though] said that /dev/sda1 was clean [because it was unmounted and an fsck could be done] and my conky showed a different size in /dev/sda1 which [I thought] I'd just been using [and I had] So yeah, I've got a clone for a backup and guess I'll need to back it up every week to keep it current, while backing up the /home every night or two like I've been doing.
Although I couldn't get the dd clone working it'll give me something to work on at my own pace. Vast One you've been utterly patient with me, guiding me through some rough spots and saying I appreciate it, well, that just doesn't seem to be enough. Thanks to you, to the other guys who posted here, and thanks to those people who took the time to read this thread. As far as I'm concerned, this thread is [SOLVED]. 
EDIT -- Say! pcmanfm has really improved since 2007, hasn't it!
EDIT -- changed some syntax, spelling
Last edited by dubois (2011-11-21 04:20:12)
Offline
Offline
@dubois
Been thinking about this and wanted to share this for better management of /home
Also, calling out to anyone (machinebacon) to verify this is correct.. should be but want a second opinion and that I am not missing something or an easier way
log into your newly created partition
terminal
sudo adduser dubois2OR any name you want
then ...obviously changing these to what is the existing user name and new user name
sudo cp -R /home/existing_username/.[a-zA-Z0-9]* /home/new_usernamethen run
sudo chown -R new_username /home/new_username/Then log out and back into that system as your new user account...
Verify that everything is working
This way, with your new user account, you can make any and all changes, updates, and run anything you want and keep your original /home account pristine
I would do this to make sure that if you made an update to the 2nd partition to Sid and it changes anything in /home, that it affects only the new account and not your stable /home account..
Am I making sense?
Last edited by VastOne (2011-11-22 17:38:31)
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
^ Yes. I like that as an extra safety feature, too. It looks good to me from what I've read recently and remember -- don't want to say I understand it all just yet. I usually have to sleep on it [literally] for a day or two for it to become a part of me. I'll make a sid partition sometime soon and use the info you and mb have posted here and elsewhere.
Sometimes I have to stop to admire just how great this forum really is! Now. Not to go OT but I'm slowly setting up Openbox in addition to my favorite, Xfce, so I'll get back to that. Thanks for checking on me from time to time. 
Last edited by dubois (2011-11-21 18:07:11)
Offline
^ Yes. It looks good to me from what I've read recently and remember -- don't want to say I understand it all just yet. I usually have to sleep on it [literally] for a day or two for it to become a part of me. I'll make a sid partition sometime soon and use the info you and mb have posted here and elsewhere.
Sometimes I have to stop to admire just how great this forum really is! Now. Not to go OT but I'm slowly setting up Openbox in addition to my favorite, Xfce, so I'll get back to that. Thanks for checking on me from time to time.
Serving at your pleasure dubois!
Good luck...
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.