Re: Replacing hard disk used in existing filesystem

2011-04-19 Thread Mark Fletcher
On Mon, 2011-04-18 at 11:32 -0400, Dan Ritter wrote:

 You had it pretty much correct; don't worry. Double-check your
 backups are good before beginning.

Thanks a lot, Dan! 

Mark


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1303218119.3184.4.camel@satellite



Replacing hard disk used in existing filesystem

2011-04-18 Thread Mark Fletcher
Hello the list!

My Debian (wheezy am464, upgraded from an original squeeze install)
system started complaining yesterday that one of my hard disks is about
to fail. I suspect it suffered damage in the earthquake that recently
hit Japan (I'm in Tokyo) and has been quietly deteriorating since.

Anyway the disk concerned is a 1TB disk on which is mounted /opt, so I
feel I should be able to replace it without major hassle. I have already
backed it up fully to NAS.

The only issue is that I don't have enough spare power connectors on my
PC's power supply to attach both the new and the old disks at the same
time.

What I want to know is how can I remove the current drive from the
filesystem so I can remove it physically without sending the machine
into a tailspin? I have only ever set up the mapping of disk partitions
to mount points at installation time, never afterwards, and so am not
sure what to do.

I am thinking the procedure will be something along the lines of:

1) modify my computer's mount settings such that /opt is part of the
root filesystem instead of a separate mount point (HOW? manual edit
of /etc/fstab or something more sophisticated?) This will cause me to
lose access to everything on the old disk which is OK because it's all
backed up and there is nothing there that's critical to the running of
the machine.

2) Power down the machine and remove the old disk, attach the new disk.

3) bring up the machine, partition and format the new disk. (is the tool
for this fdisk?)

4) modify the machine's mount settings to go back to mounting /opt on
the new disk (HOW?)

5) restore everything I want in /opt back from the backup.

Even assuming I'm on the right lines, I don't know how to do steps 1 and
4 and am not totally confident about how to do 3, so would appreciate
any advice.

Cheers

Mark


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1303138354.9098.11.camel@kazuki



Re: Replacing hard disk used in existing filesystem

2011-04-18 Thread Dan Ritter
On Mon, Apr 18, 2011 at 11:52:34PM +0900, Mark Fletcher wrote:
 Anyway the disk concerned is a 1TB disk on which is mounted /opt, so I
 feel I should be able to replace it without major hassle. I have already
 backed it up fully to NAS.
 
 The only issue is that I don't have enough spare power connectors on my
 PC's power supply to attach both the new and the old disks at the same
 time.
 
 What I want to know is how can I remove the current drive from the
 filesystem so I can remove it physically without sending the machine
 into a tailspin? I have only ever set up the mapping of disk partitions
 to mount points at installation time, never afterwards, and so am not
 sure what to do.
 
 I am thinking the procedure will be something along the lines of:
 
 1) modify my computer's mount settings such that /opt is part of the
 root filesystem instead of a separate mount point (HOW? manual edit
 of /etc/fstab or something more sophisticated?) This will cause me to
 lose access to everything on the old disk which is OK because it's all
 backed up and there is nothing there that's critical to the running of
 the machine.

Just comment out the /opt mount line in /etc/fstab. The comment
feature here is putting a # at the beginning of the line.

 2) Power down the machine and remove the old disk, attach the new disk.
 
 3) bring up the machine, partition and format the new disk. (is the tool
 for this fdisk?)

fdisk for partitioning, mkfs to create a filesystem on the
partition. You could create a label on the filesystem partition
at this time.

Read the man pages first. Use fdisk without writing anything at
the end to see what your current settings look like.

 4) modify the machine's mount settings to go back to mounting /opt on
 the new disk (HOW?)

Uncomment the /etc/fstab line, and make sure it points to the
right disk interface, or UUID, or filesystem label if you
created one.

 5) restore everything I want in /opt back from the backup.
 
 Even assuming I'm on the right lines, I don't know how to do steps 1 and
 4 and am not totally confident about how to do 3, so would appreciate
 any advice.

You had it pretty much correct; don't worry. Double-check your
backups are good before beginning.


-dsr-

-- 
http://tao.merseine.nu/~dsr/eula.html is hereby incorporated by reference.
You can't defend freedom by getting rid of it.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110418153206.gx19...@tao.merseine.nu



Re: Replacing hard disk used in existing filesystem

2011-04-18 Thread Stan Hoeppner
Mark Fletcher put forth on 4/18/2011 9:52 AM:

 The only issue is that I don't have enough spare power connectors on my
 PC's power supply to attach both the new and the old disks at the same
 time.

 What I want to know is how can I remove the current drive from the
 filesystem so I can remove it physically without sending the machine
 into a tailspin? I have only ever set up the mapping of disk partitions
 to mount points at installation time, never afterwards, and so am not
 sure what to do.

It won't go into a tailspin unless you have programs in /opt that you've
configured your system to run automatically, such as daemons.  If you
haven't, you'll simply get a mount error at startup, which is harmless.

 I am thinking the procedure will be something along the lines of:
 
 1) modify my computer's mount settings such that /opt is part of the
 root filesystem instead of a separate mount point 

You don't want to do this.

 (HOW? manual edit
 of /etc/fstab or something more sophisticated?) This will cause me to
 lose access to everything on the old disk which is OK because it's all
 backed up and there is nothing there that's critical to the running of
 the machine.

If you plan on mounting the new replacement disk in /opt, then I
wouldn't touch the settings in fstab until after you get the new disk
in, partitioned and formatted.  After that, make the necessary changes
in fstab (such as disk UUID or /dev/sdX change) to mount the new device
at /opt.

 2) Power down the machine and remove the old disk, attach the new disk.
 
 3) bring up the machine, partition and format the new disk. (is the tool
 for this fdisk?)

cfdisk is easier (menu driven)

 4) modify the machine's mount settings to go back to mounting /opt on
 the new disk (HOW?)

If the new disk shows up with the same /dev/sdX you shouldn't have to
change anything in /etc/fstab, unless you're currently mounting by-label
or by-uuid.  If it doesn't show up as the previous /dev/sdX then simply
change that to match the new /dev/sdX name.

 5) restore everything I want in /opt back from the backup.

Just make sure you're using the proper backup/restore procedure so you
get all the appropriate bits set for directories and files, such as
ownership, execute perms, etc.

 Even assuming I'm on the right lines, I don't know how to do steps 1 and
 4 and am not totally confident about how to do 3, so would appreciate
 any advice.

It would always be helpful if you add relevant information to your post,
such as a copy of your current /etc/fstab.  That would allow us to
better answer your questions, telling you exactly what to modify, etc.

-- 
Stan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4daca3ab.7050...@hardwarefreak.com



Re: replacing hard disk

2009-06-02 Thread Johannes Wiedersich
Jan Willem Stumpel wrote:
 Are there any tips on moving the whole system from the old disk to
 the new one? Or do I just have to re-install ubuntu, re-install
 any updates and extra programs which are installed, find and copy
 modified config files, mails, bookmarks, etc?

Disclaimer: I have no experience with ubuntu, therefore I'd recommend
installing debian on the new disk.

I've successfully done the following (for my debian):

- place the new disk in an usb housing and attach it to the computer
running the 'normal' OS

- format the disk and create file systems as needed (usually the new
disk is larger than the old, so file systems will be larger than on the
old disk

- copy all data as files (rsync) for / and /home (my two partitions)

- install grub on the new hard disk

- remove the hard disk from the usb housing and put it into computer

- boot to old system on new disk

- be happy 8-)

Ie. this can be done without the need of live CDs.

Note that it helps to keep the partitions in the same order, or you have
to modify /etc/fstab and /boot/grub/menu.lst

Cheers,
Johannes


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: replacing hard disk

2009-06-02 Thread Douglas A. Tutty
On Mon, Jun 01, 2009 at 04:43:12PM -0300, Claudio wrote:
 I think this tool *dd*, resolve your problem.
 
 http://www.linuxweblog.com/dd-image
 
 http://www.mckeay.net/2004/10/18/using-dd-to-clone-a-hd/

Or, you can use tar to create to stdout, pipe the output to another tar
process to extract from stdin.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: replacing hard disk

2009-06-02 Thread Seeker5528
On Mon, 01 Jun 2009 17:12:17 -0400
Stefan Monnier monn...@iro.umontreal.ca wrote:

  Are there any tips on moving the whole system from the old disk to
  the new one? Or do I just have to re-install ubuntu, re-install
  any updates and extra programs which are installed, find and copy
  modified config files, mails, bookmarks, etc?
 
 If you can connect both disks at the same time, and boot off of a Live
 CD (or a USB key), then the simplest option is:
 
 - connect both disks
 - boot off of your rescue USB/CD.
 - dd if=/dev/[olddisk] of=/dev/[newdisk]
 - wait

I prefer System Rescue CD:

http://www.sysresccd.org/Main_Page

: using ddrescue for the copy if there is any reason to suspect bad
spots in the hard drive.

With System Rescue CD all your hard drives will be sda, sdb, etc
doesn't matter whether they are sata or pata.

You can use the command:

fdisk -l

: to verify where the disks show up. Then issue the command:

ddrescue /dev/sda /dev/sdb

: assuming your old disk is sda and the new one sdb, new dis needs to
be at least as large as the old. Doing:

ddrescue --help

: will show you the syntax and list of available options.

The advantage ddrescue has is, on the first pass, when it hits a bad
spot on the disk it spends minimal effort attempting to read it before
moving on reducing the chance the drive will fail completely before you
get all the stuff from the good parts of the disk, once the first pass
is done it will make additional passes, breaking the bad spots into
smaller chunks in order to get much data as possible.

If you have a relatively small amount of stuff you consider to be of
high importance, it would be suggested to try to recover that
stuff first. Usually I will try with the file manager first, then if
there are errors during the copy, move on to other options.

Never tried ddresue with individual files, but it should be the same as
a partition or disk.

If the outfile needs to exist first you can use touch to create an
empty file:

touch /mnt/mountpoint/directory/filename

Later, Seeker


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



replacing hard disk

2009-06-01 Thread Jan Willem Stumpel
My wife's computer which runs ubuntu heron made a funny sound
today. I now think it must have come from the hard disk, which is
quite old; the motherboard and cpu are fairly new, however. And
just now the computer became unusable because it could no longer
save any files. /var/log/syslog told about a disk error which
resulted in the disk being remounted read-only. Restarting the
computer caused an fsck, and now the machine works again, but it
is clear that the disk is nearing the end of its life.

So tomorrow it's off to the computer shop to get a new hard disk.

Are there any tips on moving the whole system from the old disk to
the new one? Or do I just have to re-install ubuntu, re-install
any updates and extra programs which are installed, find and copy
modified config files, mails, bookmarks, etc?

Regards, Jan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: replacing hard disk

2009-06-01 Thread Douglas A. Tutty
On Mon, Jun 01, 2009 at 07:39:08PM +0200, Jan Willem Stumpel wrote:
 
 So tomorrow it's off to the computer shop to get a new hard disk.
 
 Are there any tips on moving the whole system from the old disk to
 the new one? Or do I just have to re-install ubuntu, re-install
 any updates and extra programs which are installed, find and copy
 modified config files, mails, bookmarks, etc?

Moving the / partition to a new drive is very OS-specific.  You may want
to ask on a ubuntu mailing list.

Doug.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: replacing hard disk

2009-06-01 Thread Tony Baldwin

Jan Willem Stumpel wrote:

My wife's computer which runs ubuntu heron made a funny sound
today. I now think it must have come from the hard disk, which is
quite old; the motherboard and cpu are fairly new, however. And
just now the computer became unusable because it could no longer
save any files. /var/log/syslog told about a disk error which
resulted in the disk being remounted read-only. Restarting the
computer caused an fsck, and now the machine works again, but it
is clear that the disk is nearing the end of its life.

So tomorrow it's off to the computer shop to get a new hard disk.

Are there any tips on moving the whole system from the old disk to
the new one? Or do I just have to re-install ubuntu, re-install
any updates and extra programs which are installed, find and copy
modified config files, mails, bookmarks, etc?

Regards, Jan




You should probably be asking this question on the Ubuntu list.
Nonetheless, you could use livemagic and livehelper, both available in 
the ubuntu repos, to my knowledge (at least, I'm pretty sure they're 
available to jaunty, not sure about hardy), to make a livecd iso of the 
existing system, from which you could install to a new disk.


do
apt-cache search livemagic
to be for sure
or just
aptitude install livehelper
which should install livemagic and livehelper
livehelper being a gui frontend for livemagic

You should, of course, back up all data/documents/music etc. to another 
disk before doing any of that stuff.


/tony

--
http://www.baldwinsoftware.com
free/open source software
tcl yer os with a feather...


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




Re: replacing hard disk

2009-06-01 Thread Claudio
I think this tool *dd*, resolve your problem.

http://www.linuxweblog.com/dd-image

http://www.mckeay.net/2004/10/18/using-dd-to-clone-a-hd/

-- 
Claudio Bazán.
Registered User LINUX #439481




On Mon, Jun 1, 2009 at 2:39 PM, Jan Willem Stumpel jstum...@planet.nlwrote:

 My wife's computer which runs ubuntu heron made a funny sound
 today. I now think it must have come from the hard disk, which is
 quite old; the motherboard and cpu are fairly new, however. And
 just now the computer became unusable because it could no longer
 save any files. /var/log/syslog told about a disk error which
 resulted in the disk being remounted read-only. Restarting the
 computer caused an fsck, and now the machine works again, but it
 is clear that the disk is nearing the end of its life.

 So tomorrow it's off to the computer shop to get a new hard disk.

 Are there any tips on moving the whole system from the old disk to
 the new one? Or do I just have to re-install ubuntu, re-install
 any updates and extra programs which are installed, find and copy
 modified config files, mails, bookmarks, etc?

 Regards, Jan


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact
 listmas...@lists.debian.org




Re: replacing hard disk

2009-06-01 Thread Stefan Monnier
 Are there any tips on moving the whole system from the old disk to
 the new one? Or do I just have to re-install ubuntu, re-install
 any updates and extra programs which are installed, find and copy
 modified config files, mails, bookmarks, etc?

If you can connect both disks at the same time, and boot off of a Live
CD (or a USB key), then the simplest option is:

- connect both disks
- boot off of your rescue USB/CD.
- dd if=/dev/[olddisk] of=/dev/[newdisk]
- wait


Stefan


PS: This presumes the new disk is at least as large as the old one.
And it will leave the additional space free: you can later on change
your partitioning (resize the last partition, or add another one) to
make use of the extra space.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: replacing hard disk

2009-06-01 Thread thveillon.debian
Stefan Monnier wrote:
 Are there any tips on moving the whole system from the old disk to
 the new one? Or do I just have to re-install ubuntu, re-install
 any updates and extra programs which are installed, find and copy
 modified config files, mails, bookmarks, etc?
 
 If you can connect both disks at the same time, and boot off of a Live
 CD (or a USB key), then the simplest option is:
 
 - connect both disks
 - boot off of your rescue USB/CD.
 - dd if=/dev/[olddisk] of=/dev/[newdisk]
 - wait
 
 
 Stefan
 
 
 PS: This presumes the new disk is at least as large as the old one.
 And it will leave the additional space free: you can later on change
 your partitioning (resize the last partition, or add another one) to
 make use of the extra space.
 
 

I use Clonezilla for such things, saves a lot of time (dd is slow),
more flexible with disk size, and takes care (if appropriate) of MBR,
grub installation on the target, and more.

http://clonezilla.org/

Handy tool.

Tom


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org