LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-09-2015, 04:04 PM   #16
odin_ago
Member
 
Registered: Mar 2011
Posts: 61

Rep: Reputation: 1

I really don't understand where the /dev/hda and /dev/hdb come from and what they mean, but it seems to me that the new hard disk already have 14 partitions (incl. "extended" ones, i. e. containing other partitions rather than containing data directly) on it, and the old one also has 14 partitions. This makes me guess that you have already copied some data to the new drive. Now I would wait until you find out where the necessary files are on the old drive.

Note that usually (esp. if you have so many partitions) the data in the /home/ folder are on a different partition than the /home folder itself. (In other words, the content of the /home folder is on a partition, which is normally mounted to the mountpoint /home. So if you see a folder home in /mnt/sysimage, which is mounted to /dev/sda5, it does not yet mean that the files in the home folder are also there.

Try the following (without the new drive, without chroot) :

1. Say
Code:
ls -a /mnt/sysimage/home
(and maybe subdirectories) and check if you have your files there. Note that the files in the /home folder and the files in the /usr folder you care about may be on different partitions!
2. If no, then follow the instruction from post 11. I would recommend to modify it slightly (the modified places are now bold)
2.0 say
Code:
mkdir /tmp/oldhome

For each n from 1 to 14, except 3 and 5:
2.1 Mount it read-only to /tmp/oldhome:
Code:
mount -r /dev/sdan /tmp/oldhome
2.2 Look at the output of
Code:
ls /tmp/oldhome
or
Code:
ls /tmp/oldhome/subdirectories
. If you see the files you need, n is your partition number
2.3 Unmount the partition:
Code:
umount /dev/sdan
(end for)

Also, it would be interesing to look at /mnt/sysimage/etc/fstab (please post it here)

Once you know the partition number(s), I would first recommend to check it the partition on the new disk with the same number is identical. Let's say the partition number is n.
1. Connect the new disk
2. Unmount the partition on the old disk if it is mounted:
Code:
umount /dev/sdan
3. Say
Code:
diff /dev/sdan /dev/sdbn
(compare the partitions number n on the old and the new disk byte by byte)

Now, if they are not identical and you want to copy files:
Either you can use dd, which is dangerous, then please say in this thread that you want to use it, I will ask you some more questions to write a step-by-step instructions
Or you can mount both of the corresponding partitions on the new and the old drive and copy files by hand. A disadvanage is that you should be careful about file owners and access rights.
To copy files by hand:
1. Create a temporary folder and mount the partition on the old drive read only:
Code:
mkdir /tmp/oldhome
mount -r /dev/sdan /tmp/oldhome
2. Create a temporary folder if you don't have it yet and mount the partition with the same number on the new drive for writing (you are going to copy data there) :
Code:
mkdir /tmp/newhome
mount -r /dev/sdbn /tmp/newhome
3. Now you can copy files with cp or mc, for example (I don't know if your rescue CD has any GUI). Note that cp can copy recursively and do other good things. For recursive copying, use -r, for other features see man cp.
 
Old 03-09-2015, 06:59 PM   #17
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
I have a brand new portable thin USB Seagate HD drive. It's never been used. That is, I haven't tried to copy my data to it yet.

-/bin/sh-2.05b#ls -a /mnt/sysimage/home
data directories of users (<-my files)

-/bin/sh-2.05b#ls -als /usr
0 1rwxrxrwx 1 root root 16 Aug 24 4:54 /usr -> /mnt/runtime/usr

-/bin/sh-2.05b#ls /usr
bin kerberos lib sbin share X11R6

-/bin/sh-2.05b#more /mnt/sysimage/etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/sda6 swap swap defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto, owner,kudzu,no 0 0
/dev/cdrom1 /mnt/cdrom1 udf,iso9660 noauto, owner,kudzu,no 0 0
#/dev/sdb1 /mnt/maxtor_usb_hd vfat, owver,kudzu 0 0

I haven't tried to unmount /dev/sdan yet. Not sure which that is. Will wait to get your input before proceeding further.

By the way, I want to copy my binaries in a root directory called /programs. (Usually people place progams in /usr/local. I don't. I also want a copy /lib files in case there are drivers I need later. In my home directory, I want to copy .cshrc .bashrc etc files)

No my rescue CD has no GUI. Which version of linux has that?

Last edited by tearsforhari; 03-09-2015 at 07:09 PM.
 
Old 03-09-2015, 07:22 PM   #18
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Apologies for the rant - you caught me in the middle of attempting to rescue another user machine.

Plenty of useful data there, but listing the device nodes (/dev/[hs]d*) is less than useful - especially on a 2.4 kernel where they would have been predefined. As root, with the external plugged in, do this. Post all the output using code tags to retain the formatting (use the advanced button, and click the # toggle)
Code:
fdisk -l
There are better tools, but I'm not sure what would have been back-ported.
 
Old 03-09-2015, 08:34 PM   #19
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
Will fdisk erase my disk?
 
Old 03-09-2015, 08:42 PM   #20
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Not when used like that - the "-l" is to list out the partition structure of all your disks. Not the data, just what partitions are defined.
 
Old 03-09-2015, 08:57 PM   #21
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
Wheww. Ok I did it:

This is without the external HD plug in:

>fdisk -l

Code:
Device   Boot Start End Blocks     Id   System
/dev/sda1       1    5  40131      de   Dell Utility
/dev/sda2       6  332  2626627+   b    Win95 FAT32
/dev/sda3 *   333  345  104422+    83   LINUX
/dev/sda4     346 30394 241368592+ f    Win95 Ext'd (LBA)
/dev/sda5     346 30140 239328306  83   LINUX
/dev/sda6   30141 30394 2040223+   82   Linux swap

Last edited by tearsforhari; 03-09-2015 at 10:13 PM.
 
Old 03-09-2015, 09:14 PM   #22
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
If you had done as requested, the formatting would be retained. Is that with the external plugged in ?. I also asked for the entire output - unedited. We need to be able to determine relative disk sizes.
 
Old 03-09-2015, 09:18 PM   #23
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
This is with the external HD plugged in:

Code:
Device     Boot Start End Blocks     Id   System
/dev/sda1         1    5  40131      de   Dell Utility
/dev/sda2         6  332  2626627+   b    Win95 FAT32
/dev/sda3   *   333  345  104422+    83   LINUX
/dev/sda4       346 30394 241368592+ f    Win95 Ext'd (LBA)
/dev/sda5       346 30140 239328306  83   LINUX
/dev/sda6     30141 30394 2040223+   82   Linux swap 

Disk /dev/sdb: 1000.2 Gb, 10000204885504 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device      Boot     Start       End       Blocks      Id    System
/dev/sdb1              1       121602    9767761558     7    HPFSNTFS

Last edited by tearsforhari; 03-09-2015 at 10:13 PM.
 
Old 03-09-2015, 09:23 PM   #24
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
I don't know what the advanced option is and the # toggle.
*Figured out the advanced option *

Last edited by tearsforhari; 03-09-2015 at 09:57 PM.
 
Old 03-10-2015, 05:31 PM   #25
odin_ago
Member
 
Registered: Mar 2011
Posts: 61

Rep: Reputation: 1
Quote:
Originally Posted by syg00 View Post
listing the device nodes (/dev/[hs]d*) is less than useful - especially on a 2.4 kernel where they would have been predefined
I didn't know about that property of 2.4 kernels...

The output of fdisk -l should start with
Code:
Disk /dev/sda:
and then its size (which can be useful if we are going to use dd). I would be also interested in looking at the output (with the new drive connected) of
Code:
lsblk -o +LABEL,PARTLABEL
. Or, if this produces an error, then the output of
Code:
lsblk -o +LABEL
lsblk -o +PARTLABEL
(one command should produce an error, the other should work.

For a rescue CD with GUI, I usually use Gentoo LiveDVD https://www.gentoo.org/news/20140826-livedvd.xml . But I am not sure about:
(a) how it will work on your old hardware
(b) if you do any modifications in your system, I am not sure that the old kernel you normally use will understand them well. If you just edit and copy files, I guess it should be OK.

I think I know enough now to say how to copy files to your new disk, but I would wait and see what syg00 will say, because he apparently knows the old kernels better than I. For example, it seems that your new drive has NTFS filesystem on it (which can be changed, but it is much easier, if not only possible, to do this before you copy the files), and I don't know how well the old kernels work with it. Please note that it is either impossible or very non-standard to use NTFS filesystem for a linux root filesystem.

What do you want to do with your new disk? Do you want to use it just for string files or do you want to make it bootable and "primary" disk for a linux computer?

Here is my instruction (make a backup of particular files without changing the filesystem).
1. Boot from the rescue CD (preferably in read-only mode, we are not going to modify anything in the old system now) and make sure that the files you need are present in /mnt/sysimage
2. Connect the new disk.
3. Create a directory and mount the new disk:
Code:
mkdir /mnt/newdisk
mount -t ntfs-3g /dev/sdb1 /mnt/newdisk
4. Copy the files you want. The root of the new disk (or, more precisely, of the first and the only partition on it) is /mnt/newdisk
5. Unmount the new disk:
Code:
umount /dev/sdb1
A folder called /programs looks like a very non-standard idea for me, but I don't see any errors this can lead to (with my linux experience being not very rich).
 
Old 03-10-2015, 08:42 PM   #26
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
Ok. I connected an old 40G USB external formatted with VFAT and was able to copy the files I wanted onto it.
I used
Code:
mount -t vfat /dev/sdb1 /mnt/old_usb_hd
cp -r /mnt/sysimage/programs/* /mnt/sysimage/mnt/old_usb_hd/programs

I haven't tried the
Code:
mount -t ntfs-3g /dev/sdb1 /mnt/newdisk
on the new USB drive that holds 1TB. DO you think it will work to copy the entire disk? Tried it: ntfs-3g not supported by kernel.

Can you tell me how to figure out how much disk space I used on my linux drive and how much space I have left on my old 40G drive? Maybe I can just copy everything onto that.

I tried the lsblk command. It doesn't know that command.

Ok. Now that I have all the files I need, I would really prefer to get the boot to work. I had a lot of drivers set for the 3D to work with the video card, and I can't find my notes to redo it. Maybe the boot problem has something to with MBR being corrupted or I lost a mount point. Any suggestions?

Last edited by tearsforhari; 03-10-2015 at 09:51 PM.
 
Old 03-10-2015, 09:17 PM   #27
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
at the grub boot prompt hit e to edit the kernel line to change root=LABEL=/ to root=/dev/sda5
 
Old 03-10-2015, 09:39 PM   #28
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
I tried that Colorpurple many times. It says:
Code:
Mounting /proc filesystem
Creating block devices
kmod: failed to exec /sbin/modprobe -s -k block-major-8, errno = 2
VFS: CAnnot open root device "sda5" or 08:05
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 08:05"
I tried this when it boots and gives a list of kernels to choose from, not a grub prompt per se. I type e and it allows me to edit.

I also tried /dev/sda3, but got a similar error.

Last edited by tearsforhari; 03-10-2015 at 09:43 PM.
 
Old 03-10-2015, 09:43 PM   #29
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
try root=/dev/hda5
 
Old 03-10-2015, 09:55 PM   #30
tearsforhari
Member
 
Registered: Mar 2015
Posts: 79

Original Poster
Rep: Reputation: Disabled
No, here's the line I am editing:
Code:
root (hd0,2)
kernel /vmlinuz-2.4.21-4.EL ro root=/dev/hda5 hda=ide-scsi hdb=ide-sci apic
initrd /initrd-2.4.21-4.EL.img
Similar error

Last edited by tearsforhari; 03-10-2015 at 09:56 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2.6.19: VFS: Cannot Open root device "sda1" or unknown-block(0,0) havok1977 Linux - Kernel 19 02-24-2021 12:35 AM
VFS: cannot open root device "sda3" or unknown-block (0,0) snakeo2 Linux - Newbie 10 07-05-2012 08:23 PM
VFS: cannot open root device "sda1" or unknown-block(2,0) elninio Linux - General 2 10-29-2008 04:05 PM
FC2; VFS: Cannot open root device "LABEL=/" or unknown-block(0,0) Starchild Fedora 11 01-18-2006 03:39 AM
VFS: Cannot open root device "1601" or unknown-block(22,1) takehora Slackware 3 06-11-2004 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration