LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2005, 03:59 PM   #31
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by saikee
Once you have mount the partition it becomes part of the filing system that you can operate in the desktop. So just drag and drop as much as you like there. The command to list your filing system in shell should
Code:
ls /
and
Code:
ls /boot
and so on to search anything you want when the GUI desktop is unavailable for some reason.
I don't have a GUI installed on the machine. I can browse my tree graphically via WinSCP. Either way, using the command line, I ran ls -l /mnt/hda1/ and it said, "No such file or directory." I should have seen a directory and a file there that I moved previously.
 
Old 12-28-2005, 06:32 PM   #32
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Linux ls = dir in Windows.

It is available in every Bash shell in Linux and every sh shell in BSD.

No GUI is needed.

Last edited by saikee; 12-28-2005 at 06:38 PM.
 
Old 12-28-2005, 06:36 PM   #33
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
hmm...

This is what I get, and I am at the server console using the bash shell:
Code:
server1:~# fdisk -l
server1:~#
Same results with PUtty.
 
Old 12-28-2005, 06:42 PM   #34
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Well, I decided to do the dd command to one of the new drives. Got an error though when trying to setup the partition:
Code:
server1:~# mke2fs -j /dev/hdb1
mke2fs 1.37 (21-Mar-2005)
mke2fs: Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to reboot
        to re-read your partition table.
I think I must have missed a step somewhere...
 
Old 12-28-2005, 08:13 PM   #35
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Are you running your Linux via the network?

my fdisk -l &
mke2fs -j /dev/hda22

show

Code:
linux:~ # fdisk -l

Disk /dev/sda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3187    25599546    7  HPFS/NTFS
/dev/sda2            3188       36483   267450120    c  W95 FAT32 (LBA)

Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        3187    25599546    7  HPFS/NTFS
/dev/hda2            3188        4403     9767520   83  Linux
/dev/hda3            4404        5619     9767520   83  Linux
/dev/hda4            5620       24792   154007122+   5  Extended
/dev/hda5            5620        5984     2931831   82  Linux swap / Solaris
/dev/hda6            5985        7200     9767488+  83  Linux
/dev/hda7            7201        7808     4883728+  83  Linux
/dev/hda8            7809        9024     9767488+  83  Linux
/dev/hda9            9025        9632     4883728+  83  Linux
/dev/hda10           9633       10848     9767488+  83  Linux
/dev/hda11          10849       11456     4883728+  83  Linux
/dev/hda12          11457       12672     9767488+  83  Linux
/dev/hda13          12673       13280     4883728+  83  Linux
/dev/hda14          13281       14496     9767488+  83  Linux
/dev/hda15          14497       15104     4883728+  83  Linux
/dev/hda16          15105       16320     9767488+  83  Linux
/dev/hda17          16321       16928     4883728+  83  Linux
/dev/hda18          16929       18144     9767488+  83  Linux
/dev/hda19          18145       18752     4883728+  83  Linux
/dev/hda20          18753       19968     9767488+  83  Linux
/dev/hda21          19969       20576     4883728+  83  Linux
/dev/hda22          20577       21184     4883728+  83  Linux
/dev/hda23          21185       21792     4883728+  83  Linux
/dev/hda24          21793       22400     4883728+  83  Linux
/dev/hda25          22401       23008     4883728+  83  Linux
/dev/hda26          23009       23616     4883728+  83  Linux
/dev/hda27          23617       24224     4883728+  83  Linux
/dev/hda28          24225       24792     4562428+  83  Linux
linux:~ #                             
linux:~ # mke2fs -j /dev/hda22
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
611648 inodes, 1220932 blocks
61046 blocks (5.00%) reserved for the super user
First data block=0
38 block groups
32768 blocks per group, 32768 fragments per group
16096 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
linux:~ #
It is customary to reboot the PC every time you partition a hard disk so that the operating system can use the new setting. Think your post missed that step out.
 
Old 12-28-2005, 09:17 PM   #36
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee
Are you running your Linux via the network?
No, Debian is installed and running locally on hda and the new 80GB hdb is installed in the second bay. Both drives are set to 'cable select'.
Quote:
Originally Posted by saikee
It is customary to reboot the PC every time you partition a hard disk so that the operating system can use the new setting. Think your post missed that step out.
After installing the new drive I ran:
Code:
mke2fs -j /dev/hdb1
and got:
Code:
mke2fs 1.37 (21-Mar-2005)
mke2fs: Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to reboot
        to re-read your partition table.
I even rebooted and tried again.

I then realized that hdb1 is still mounted via /mnt/hdb1 from earlier. How do I unmount it? I tried:
Code:
server1:~# unmount /mnt/hdb1
-bash: unmount: command not found
server1:~#
Any ideas?
 
Old 12-28-2005, 09:25 PM   #37
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Let me ask another question...

Say I go ahead and install the two new 80GB drives and install Mandriva on hda. I could easily use the partition manager during setup for both drives. Then I could setup the server like I need to, but I will need to copy some databases and config files to it from the Debian drive.

Obviously I will need to store the needed files on my WXP computer using ssh, but I have found out that transferring these files will not include the permissions and ownerships that are currently set. If I tar the mix of files, copy them to my WXP computer, wouldn't the files preserve the permissions, etc when I untar them back onto the Mandriva install?

If so, this may be the route I should take...

Oh, how should I partition hdb during the Mandriva install to where I can dd hda -> hdb? Should it just be one partition or should I duplicate the same exact partitioning as I do on hda? I would want to make an image hda -> hdb that would be an exact duplicate if hda were to fail. This is the setup I think I would desire...
 
Old 12-29-2005, 07:38 AM   #38
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
To unmount a device the Bash command is
Code:
umount /mnt/hda1
I was caught out by it too before too.

For the work you are doing may I suggest you get a copy of "Linux in a Nutshell" by Siever, Figgins and Webber published by O'Reilly. The book is essentially a collection of Bash commands but also it has excellent sections on boot loaders and text editors commands.

There is no harm in going ahead to install your hard disk. All you need is to have a scheme thought out first that will satisfies your ultimate requirements. Both the tar and dd commands will preserve the permissions, otherwise we can just use drag and drop in Xwindows , would we not?

In my write-up for booting the 100+ systems I wrote Section "H" on recommendations for users intending to multi boot. The first recommendation I proposed is always to partition the disk before the installation. The 100+ system Grub menu and the partitioning details actually show I had 20 empty partitions arranged to be booted even before I install the Linux into them. Therefore I would recommend to you to use "cfdisk" program available in 75% of the Linux. The distros that do not use it are the Red Hat family as they have "sfdisk" instead. It is essential that you develop the skill with one partitioning program so that you can use the same program to get you out of trouble in future. You can partition your hard disk without a Linux in a hard disk because cfdisk is available in Live CDs.

The main reason of sticking with one partitioning program is if you allocated 10000Mb for hda1 you can write 10000Mb when partitioning hdb2 you can be sure that the two will be spot on in size so that dd will be a piece of cake later on. There is always a bit of translation, rounding off problems in 1024 bytes, 1k and 1Mb units so it pay to stick with one type of translation only if you have a need to use dd.

In your case I would make both disk identical and this would be the way to do it.

Partition only one disk, install all the softwarein it, use this command to mirror hda to hdb in one operation
Code:
date
dd if=/dev/hda of=/dev/hdb bs=32256
date
Have a look at the command always before pressing the enter key as it is essential that no mistake is made. Read it loud that it is "dd" input file equal device hda and output file equal device hdb. The block size parameter 32256 is product of 63 sector x 512 bytes representing one complete cylinder track. Without it dd will default to 512 bytes in each data transfer and can be slow. The bs=32256 is about the optimum from my experience. The two date statements give you the times taken for the task. They are optional. However for a task like this you should have an idea of how long it takes so that you know something wrong immediately if the time doesn't match up your expectation. dd does go wrong at all in my experience but just have a clear mind about your "source" and "target". The damage to have them in reverse order is unrepairable!

This way you can test the dd to your satisfaction by pull out the hda and insert only the hdb into hda's position in PC, boot it up to check it works exactly as the original hda. You then mark this disk as No 2 and hda as No 1 and plug the original hda into the hdb position as the permanent arrangement. There is no needed to put No 1 disk in hda position if both of them are mirror of each other.

If you have purchased two identical disks the above will work out, as I have cloned 200Gb sets and 300Gb set disks this way. If it doesn't work you can go after me with a shot gun.

Last edited by saikee; 12-29-2005 at 07:51 AM.
 
Old 12-29-2005, 09:12 AM   #39
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Here is what my current hda looks like:
Code:
                                  cfdisk 2.12a

                              Disk Drive: /dev/hda
                        Size: 80026361856 bytes, 80.0 GB
              Heads: 255   Sectors per Track: 63   Cylinders: 9729

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    hda1        Boot        Primary   Linux ext3                          98.71
    hda5                    Logical   Linux swap                        1850.69
    hda6                    Logical   Linux ext3                       78074.36


     [Bootable]  [ Delete ]  [  Help  ]  [Maximize]  [ Print  ]
     [  Quit  ]  [  Type  ]  [ Units  ]  [ Write  ]

                 Toggle bootable flag of the current partition
and HEY! fdisk -l works on this install lol:
Code:
[root@server1 ~]# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          12       96358+  83  Linux
/dev/hda2              13        9729    78051802+   5  Extended
/dev/hda5              13         237     1807281   82  Linux swap
/dev/hda6             238        9729    76244458+  83  Linux

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1           1           0    0  Empty
Partition 1 does not end on cylinder boundary.
Here is hdb:
Code:
[root@server1 ~]# fdisk -l /dev/hdb

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1           1           0    0  Empty
Partition 1 does not end on cylinder boundary.
I guess I need to decide which tool I need to become more acustomed to so I can use it as standard.

I read par of your 100+ systems. I actually found it at justlinux.com. Do you have it posted at a non-forum site somewhere? I will be sure to read it when I get some time.

I was just thinking that I need to get another book on linux. The only one I have is from school on shell programming. It has some good info, but it is geared towards shell programming and that is about it. I may try the book you referred me to--thanks!
 
Old 12-29-2005, 10:16 AM   #40
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I always use fdisk -l for seeing the partition information only.

For partitioning I stick with cfdisk because (1) You can see things as they happen and (b) It is compatible with all other partitioning tools except Partition Magic. PM is a Windows product claims to support Linux but always trashes the partition table. Any Linux user has some experience would ignore this product. Typical it always report errors in Linux partitions and offer to fix them. The fact is it doesn't understand Linux fully and always turn a sound partition table into a faulty one. Remember I told you this and keep an eye on the forum.

My 100+ system write-up has a lot of information intending to help users wishing to multi boot. There are many sources of information too but mine was based on the 100+ systems I installed. There could be areas that are of no interest to you. I have to make it long to cover all the ground. If you have a problem of booting looking at the published Grub menu and the partition scheme should give you sufficient clue to overcome your own problem.

Regarding your own partition table you don't seem to have an data partition or a Dos partition there. You need to highlight the hda1 and use the direction key to click "type" to select "6" if you want hda1 to become Fat32. The partition table would only be written if you click "write" before exit.

You can keep on deleting and creating the different partitions until a final scheme is reached. It only become permanent if you write it and reboot.

Also until you put things inside the partitions you can amend it without consequence. The partition table is best imaged as the door bells of a large apartment blocks. The complete destruction of the door bell system will not affect the tenants inside. So as long as you have a partitioning scheme written down you can rebuld the partition table. My 60-partition and 54-partition tables of hda and hdc were trashed over half a dozen times and I rebuilt them from scratch without suffering any loss, except in one occasion I noticed the distro was formatting my whole disk. I stop it, lost my first Dos partition but recover the 59 after it. The formatting of the hda1 wiped out the entire partition table.

When you partition a hard disk you are only playing around with 64 bytes in the 447th to 510th bytes of the hard disk. Each partition has 16 bytes for recording the information shown in fdisk & cfdisk.
 
Old 12-29-2005, 01:36 PM   #41
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Man, if you keep going I won't have to read the book that I just ordered...

I just ran the dd command and it worked great. I haven't tried booting the drive, but will later...

Now if I want to move a particular file from hdb to hda, what would the command be? Something like cat /dev/hdb/etc/myfile > /dev/hda/etc/myfile ?

What I am wondering is if I setup this Mandriva in hda, and put my old debian (that currently contains all of my custom files/data) in hdb, how do I copy these files to the specific directories from hdb -> hda?
 
Old 12-29-2005, 04:25 PM   #42
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Wow, just ran dd and look how long it took: (pay no attention to the exact time, but it did take 2h23m.)
Code:
[root@server1 ~]# date
Thu Dec 29 08:54:06 EST 2005
[root@server1 ~]# dd if=/dev/hda of=/dev/hdb bs=32256                                                                        ^[[C2480976+0 records in
2480976+0 records out
[root@server1 ~]# date
Thu Dec 29 11:22:03 EST 2005
Shouldn't it be just a little faster than that?
 
Old 12-29-2005, 05:15 PM   #43
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
If you move your data only and not the system files you can mount the hdb partition on Debian's filing tree and just do a drag and drop. Between fellow Linux this is the standard method. say you there is a file in hdb2 you want to see or move files to there you just do it in Debian with
Code:
mkdir /mnt/hdb2 
mount /dev/hdb2 /mnt/hdb2
I would then go to the desktop and click two windows, one for /mnt/hdb2 and another for the directory of Debian. Drag and drop is a respectable way of going about it although you can do it in Bash shell. Say copying all the files in /home of Debian to the /mnt/hdb2/home would be
Code:
 cp /home/* /mnt/hdb2/home
Now on the speed

That depends on the age of the distro and also you hardware. Not all Linux are the same and that is the time to tell which one is a man from a group of boys. I would expect Mandriva to do better. The best or most reliably faster Linux I experienced is Suse as it optimised the kernel during installation time. In my older PC, with Athlon 2800 the fastest cloning time is about 2.5h for 200Gb disk. But using Konppix I have clocked 20 times longer! I have not recorded the 300Gb cloning time on my latest AMB64 3200 but the earlier 100 sec for a 5 GB partition came from it. Extrapolation would suggest I could get away with about 0.5 hour using the Suse 10.1 c86 64 distro to clone a 80Gb disk.

Debian has one of the oldest kernel and not known to be a fast performer. Knoppix is Debian-based and I can never forget it took more than a day while Suse did it in 2.5 hours.
 
Old 12-29-2005, 06:20 PM   #44
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Excellent information. I appreciate it. Well, I think I am going to finish fighting
through the Mandriva install. Afterwards, I will try to install the Debian drive as
hdb and attempt to copy the needed files over to hda. I will feel like a master if
all this works without error...yeah, whatever...my luck isn't that good, but my
trainer is. Thanks again.
 
Old 12-29-2005, 06:31 PM   #45
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
I tried:

Code:
[root@server1 ~]# mkdir /mnt/hdb2
[root@server1 ~]# mount /dev/hdb2 /mnt/hdb2
mount: special device /dev/hdb2 does not exist
[root@server1 ~]# rmdir /mnt/hdb2
Then tried:

Code:
[root@server1 ~]# mkdir /mnt/hdb6
[root@server1 ~]# mount /dev/hdb6 /mnt/hdb6
mount: special device /dev/hdb6 does not exist
What does this mean?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
move grub dmenezes Linux - Newbie 1 08-28-2005 12:26 AM
Help with Grub: move it to /boot linda Slackware 14 11-01-2004 08:29 PM
How do i MOVE grub? MadSkillzMan Linux - General 5 10-26-2004 06:54 PM
Move from GRUB to XP geekBass Linux - Newbie 1 03-09-2004 01:24 AM
Grub/booting problems after partition move jacobly Linux - Newbie 3 09-02-2003 09:33 AM


All times are GMT -5. The time now is 12:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration