Jump to content

Best way to clone my headless server


ichase
 Share

Recommended Posts

Greetings all, for those who celebrate the Thanksgiving holiday in the states, I hope you all had a wonderful day yesterday. Thanksgiving is a time to give thanks for things that bring you peace and hapiness so I would like to say: I give thanks to the fine men and woman here at BATL that I have made friends with over the last couple of years. You all are an exceptional group of people.

 

SO as the subject states, my headless file and print server is running great. I normally use clonezilla to clone all my partitions and in this case, I could hook up a monitor, keyboard and mouse to the server and clone using clonezilla, but is there a better way over secure shell to make a clone of /dev/sda1 on the server?

 

I always like the piece of mind knowing if I screw something up, I can always re-image the partition and start all over.

 

Thanks and have a great weekend all,

 

Ian

Link to comment
Share on other sites

securitybreach

Cloning over ssh is one of the options on the livecd:

Clonezilla includes an OpenSSH server. To connect to it from a remote host, just run "service ssh start". If the network isn't up, run "dhclient eth0" and check with "ifconfig" that Clonezilla got an IP from the DHCP server

 

http://www.howtoforge.com/back-up-restore-hard-drives-and-partitions-with-clonezilla-live

Link to comment
Share on other sites

Instead of installing all that hardware, why not just insert your USB stick Clonezilla Live in the server and run it from a remote terminal over SSH?

No clue on how to do that, looks like I have more reading to do. :thumbsup:

Link to comment
Share on other sites

Ok, in playing with clonezilla, what you can do is save the image you create on of the host computer's partition onto the server. There is nothing that allows you to actually clone the server's partition. I have tried a few google searches but nothing seems to be coming up with what I am trying to do. Could be my verbage that I am using in my search criteria.

 

Amenditman mentioned installing clonezilla on USB then accessing it via ssh. Could I not just put a live CD of clonezilla in the server, and run everything via ssh? Not even sure if I know what to run after doing that. I guess I would mount the CD and find the file to start to get clonezilla running.

 

I'm with you on this one Eric, I don't want to hook up the monitor and other periphials, it defeats the purpose of being headless.

 

With everything working great, I would just like the piece of mind knowing I have a good image to restore if I happen to screw something up. They have saves me COUNTLESS times on the laptop and desktop. ;)

Link to comment
Share on other sites

We're going to need someone that's an expert using ssh to chime in here. I don't use it much and can't describe how to do this.

 

My suggestion was to boot the server using Clonezilla Live (CD or USB), then ssh into the server and run the program. Clonezilla Live does allow you to mount a remote filesystem over ssh or samba to use as the storage repo for the image created or to restore from.

Link to comment
Share on other sites

Ameditman, you are correct, I can make a clone of my partition here on the lappy and save it on the server. Just have not figured out how to remotely make a clone of sda1 on the server without adding the perefials. That would not take long but as mentioned, it defeats the purpose of being headless.

 

I control everything on the server via ssh from this laptop. Updates, config files etc. It has been working great. If I can figure out how to make a clone of sda1 on the server from the laptop, I would have pretty much added the last piece of the puzzle.

Edited by ichase
Link to comment
Share on other sites

Here is a method using dd instead of clonezilla: http://linhost.info/...ip-and-openssh/

My concern with that method, or any other method that does not boot from alternate media, is that you have to unmount the partition to be cloned. Obviously, a problem on a running server. That is why I thought to boot the server from Clonezilla Live or PartedMagic, SSH into the live environment, and run Clonezilla.

Link to comment
Share on other sites

My concern with that method, or any other method that does not boot from alternate media, is that you have to unmount the partition to be cloned. Obviously, a problem on a running server.

I would have thought that any attempt to clone a running server would be fraught with potential hazards as files would change during the duration of the process. I'm no expert but I'd say taking the server offline temporarily would be safest.

Link to comment
Share on other sites

There has; as expected, been some great food for thought here. I have done my research, and at this point, it really seems the most simplest and safest approach is to take the server offline, plug in monitor, keyboard, and mouse. Clone the partition with Clonezilla, unplug peripherals and reboot. As I do not plan on doing any more updates via pacman with the server (no sense in updating if everything is working great) this would be a one time thing. If I decide to perform updates or even convert the server to systemd (which I am on the fence about) then having the image handy in case something goes wrong just seems like the best alternative. While I have the peripherals plugged in, may not be a bad idea to convert it to systemd? Should be simple, not many daemons to run, no wm/de, better tools to check the status (journalctl -B) must admit I really like systemd.

 

I think I just talked myself into transitioning the server to systemd. :hysterical: Though at the same time with it running so great and being able to access the server and printer from any computer in the house is nice. The term "Don't fix it if it ain't broke" comes to mind. Decisions Decisions. ;)

Link to comment
Share on other sites

Guest LilBambi

:hysterical:

 

Hope that works well for you, Ian! Does sound like a good idea though.

 

BTW: Did you say this server was only a local server; meaning no access to the Internet needed? If so you don't even need to give it a path to the internet/gateway except manually periodically to do updates. Then it will truly just be a local server and only local computers can access it directly. You may already know this and it's redundant to say so. I didn't read the whole thread through. So forgive me if it is redundant.

Edited by LilBambi
Link to comment
Share on other sites

Hey Fran, I always am happy to see a reply from you and I always value your opinions and guidance. :) I hope you are coming off a great long enjoyable Thanksgiving weekend. :)

 

This is just that, a local server upstairs under a table that provides storage and print services for all the computers in the house Windows and Linux. I control all aspects of the sever remotely via SSH on my laptop downstairs. The server is running a bare bones Arch linux OS with SAMBA and a few other tools for administration purposes.

For piece of mind, because setting everything up was a learning experience, I wanted to clone the partition the OS is installed on because later on I want to spend more time in the samba config file and try new things such as making it accessable "outside" the network so I can access it if on travel and if I bork it up I can just re-image and be back to where I was.

 

I was just wondering if remotely doing this would be easy, but after looking at the links supplied and guidance, it's really going to just be easier to hook up the monitor, keyboard, and mouse and run clonezilla like I do on my laptop and desktop. These items are on top of this table which is my work station when working on custormer computers.

Link to comment
Share on other sites

Guest LilBambi

Sounds like an excellent plan regarding cloning. Would definitely do that before the upgrade too. ;)

 

A thought regarding remote access. Since you currently access it remotely via SSH locally. Why not keep it totally within the network and use a remote access client to your desktop which is already on the Internet, and then SSH in from there. Keeps the server much safer that way.

 

And yes, had a wonderful Thanksgiving Holiday weekend! Thanks for asking! Hope yours was too!

 

I was wondering who the other VA connection to chat was the other day. So sorry I missed you. Didn't realize the name until Josh said it was you and I broke the Nickname apart and went, duh! Sorry to have missed you.

Link to comment
Share on other sites

securitybreach

It all sounds like a good plan but I do have a comment on one of your ideas:

As I do not plan on doing any more updates via pacman with the server (no sense in updating if everything is working great) this would be a one time thing. If I decide to perform updates or even convert the server to systemd (which I am on the fence about) then having the image handy in case something goes wrong just seems like the best alternative.

 

Do you mean right now or later down the road? The reason I ask is because you may end up with a broken system if you do not run the updates occasionally. Having a clone will not help as it will also be broken again as soon as you run the updates. If you want to just update the system and leave it be, it will work as it does now. Just keep in mind that later down the road, you may have to reinstall if you ever decide to run the updates. That said, when you do decide to update later down the road, it will help to backup all your configuration files in /etc (mine is only 55mb) first. That way you can just reinstall the packages, drop your /etc configuration files back in and you should be about the same as before with an occasional configuration change.

 

Cayden: This is not true on most distros but Archlinux is a rolling distro which basically means it uses a:

Rolling update development model refers to a continually developing software system; this is instead of a standard release development model which uses software versions that must be reinstalled over the previous version. Rolling software, instead, is continually updated, in contrast to standard release software which is between versions.
  • Like 1
Link to comment
Share on other sites

Guest LilBambi

Archlinux is also bleeding edge. Not the best for a new Linux Explorer. I am not a new Linux Explorer and I don't use it either. ;) Not to say it's not a great distro. It is. But I need something much easier to use and stable than something that is bleeding edge.

Link to comment
Share on other sites

Josh,

Actually the more I am thinking about it, the more that converting this server to systemd just makes sense. I am still doing daily updates via SSH but figured that with systemd getting closer to be the standard that if I don't update it, eventually the updates will break the system anyway.

Once I worked through the issues on the laptop (with help from others on the Arch Forums), I was quickly able to get the desktop up and running on systemd based on the issues I had on the laptop. I figure that converting the server to systemd should be fairly quick especially with it being so minimal.

 

Excellent idea in saving my /etc folder. At least there, I already have all the config files that currently work readily available. To be honest with you, I did not even think of that simple process. :thumbsup:

 

@Fran

A thought regarding remote access. Since you currently access it remotely via SSH locally. Why not keep it totally within the network and use a remote access client to your desktop which is already on the Internet, and then SSH in from there. Keeps the server much safer that way.

 

As I am not above stating "I do not understand" I will state it now. :hysterical: I do not understand what you mean? LOL

 

I was wondering who the other VA connection to chat was the other day. So sorry I missed you. Didn't realize the name until Josh said it was you and I broke the Nickname apart and went, duh! Sorry to have missed you.

No problem at all, it is so few and far between that I actually get to log into IRC that it only makes sense that me popping up in there would be "WHO DAT?????" :hysterical:

 

Edited by ichase
Link to comment
Share on other sites

Guest LilBambi

LOL! No worries.

 

I mean remote into your Desktop computer (could even use SSH for that to if you like). Then SSH into the local only server from your Desktop computer.Is that clearer?

 

Here are some other remote desktop options for Linux.

Edited by LilBambi
Link to comment
Share on other sites

I have not tried the -X option, hmmmmmmm, more reading in my future. One of these days I am going to actualy read a "BOOK" that tells a story :hysterical: Ever heard of such things?

Link to comment
Share on other sites

Guest LilBambi

Well, there are audiobooks. That's how I do it very often these days. Reminds me of Ray Bradbury's Martian Chronicles. In fact, that was one of the first things that intrigued my Jim when he first saw the movie years ago. As I sit listening to my book. Seems that is a paraphrase from the beginning of the movie.

 

Ray Bradbury had some great things to say about reading, books, etc.:

 

You don't have to burn books to destroy a culture. Just get people to stop reading them.

 

There are worse crimes than burning books. One of them is not reading them.

 

So seems to me whether it's dead tree books, ebooks, or audiobook and whether it's fiction, non-fiction, science-fiction, etc., etc. If we are reading, we are doing very well by Ray Bradbury's yardstick. :yes:

Edited by LilBambi
Link to comment
Share on other sites

LOL! No worries.

 

I mean remote into your Desktop computer (could even use SSH for that to if you like). Then SSH into the local only server from your Desktop computer.Is that clearer?

 

Here are some other remote desktop options for Linux.

Ahhhhhhh, I think I got it. Use the laptop, establish a connection to the desktop upstairs via SSH. Once at the command prompt for the desktop, SSH into the server. So by doing this, what exactly will this accomplish in regards to safety?

 

I don't have any graphical applications on the server so technically enabling X11 forwarding would not matter. I could use it to run graphical programs installed on the desktop upstairs but I don't think I have any graphical programs on the desktop that are not already installed on the server?

 

But of course I am still going to try that X11 forwarding so I can check out running a graphical program on the laptop that is actually installed on the desktop upstairs. Sounds cool :thumbup:

Link to comment
Share on other sites

Guest LilBambi

What would it accomplish safety wise. Well, for one thing, you will have it on the local net only you said. Updates would therefore be sporatic most likely. It would of course protect whatever data you have on that server by keeping so only a computer on the local network, directly, or by SSH over the local network, could access it.

 

We don't use X-11 either. But to a Desktop over a good cable connection, that would be very nice.

Link to comment
Share on other sites

Now I have opened up my port that I use to access my server on the router settings. If I am "outside" my network, for example, in another state on travel. I can still access the server via secure shell correct?

In Linux, I mount my storage drive on the server via ssh but would like to be able to access those same files if I am on travel.

Link to comment
Share on other sites

securitybreach

If you have ssh running and the port is open via your router, you can access your ssh server from anywhere. I frequently connect to my main machine running ssh using my Android smartphone. I also have a ssh server running on my VPS, which is over 1000 miles from me, that I am constantly connected to. So yes, you can connect to your ssh server outside your network.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...