disk management


Results 1 to 13 of 13

Thread: disk management

  1. #1
    Join Date
    Sep 2004
    Location
    Canada
    Posts
    23

    disk management

    Hi all:
    I'm planning to clone the image of my current config (CENTOS) using partimage.
    I have installed a second hard drive which displays on the hardware browser.

    I would like to format the 2nd drive and have encountered some challenges that I need some help with.
    First, is there a command line command to accomplish the formatting task.
    I have also tried to locate and download partition magic with no success.
    Does anyone have a link where I could download a copy.
    Tried qparted as well, however, made several attempts to install with no
    success.

    Finally, is there a file management tool like (Explorer in windows) which displays all disk drives, files, directories and sub-directories.
    Explored conquerer, but just shows config on the primary drive.

    A safe and happy holidys to all.

  2. #2
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,953
    Best tool to look into all the drives with all the partitions is a Bash command
    Code:
    fdisk -l
    Best tool to clone a small drive into a big one, also a Bash command
    Code:
    dd if=/dev/hda of=/dev/hdb bs=32768
    Best partitions management tool just download----->Parted Magic

    It is maintained by a JL forum member who previously also involved in maintaining gParted.
    Last edited by saikee; 12-30-2006 at 11:49 AM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  3. #3
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,950
    Quote Originally Posted by redrat101
    Finally, is there a file management tool like (Explorer in windows) which displays all disk drives,
    There's no such thing as a "disk drive" at the filesystem level. Linux has one global filesystem that contains the filesystem on each disk partition (as long as each is mounted), plus a bunch of other FS types that don't really exist anywhere on disk (like /proc, /sys, and /dev/pts). But they're all mounted at places in the main FS tree, which starts at "/".

    Explored conquerer, but just shows config on the primary drive.
    ?

    Konqueror should show you everything that's currently mounted (assuming you have read permission). Maybe you weren't looking in quite the right place? It used to be that stuff was mounted in subdirectories under /mnt (like /mnt/windows, which was a fairly popular place to put a Windows partition's FS if one is found during setup, and /mnt/cdrom, which is where a CD drive got mounted). But this didn't quite conform to the various filesystem standards (/mnt itself was supposed to be a "scratch" mount point; there weren't supposed to be any subdirectories), so a bunch of distros have moved to /media instead of /mnt.

    In short: Look around in /media (and possibly /mnt), to see if you can find whatever data you're looking for.

    Also: Partition Magic is horrible at Linux support. You'd be much better off using native tools, like the Parted Magic that saikee linked to. Besides, downloading Parted Magic would actually be legal.

    As for formatting a partition: After running gparted or parted or Parted Magic, or fdisk, or cfdisk, or whatever tool you choose, you should see the new partition in /dev (it'll be /dev/hd<letter><number> if it's an IDE drive, and /dev/sd<letter><number> if it's SCSI or SATA or PATA-under-libata (but the last is extremely experimental still, so I doubt your PATA drive would show up as sdX yet)). The <letter> depends on the bus position (for IDE, the primary master is hda, the primary slave is hdb, the secondary master is hdc, and the secondary slave is hdd), and the <number> depends on the partitioning scheme. Generally if you just make one huge partition, then you'll be using hd<letter>1.

    To make a filesystem (a.k.a. format the partition), use mkfs -- for example, "mkfs -t ext3 /dev/hdd1" will create a new ext3 filesystem on the partition /dev/hdd1. You will want to make absolutely sure you have the correct partition, though, otherwise you can screw up your main system.
    Last edited by bwkaz; 12-30-2006 at 12:55 PM.

  4. #4
    Join Date
    Sep 2004
    Location
    Canada
    Posts
    23
    First!!! Thanks to both for the great response.

    I downloaded and tried Parted Magic, live CD works great with formating task.
    Live CD is an excellent concept!

    Sakee, do you have a link to Parted_Image and does it have the Live CD concept as well.
    I noticed the clone command that you've outlined, however, what about the Restored
    command.
    More-so do I need to mount the 2nd drive (IDE) before I can view contents in Konquerer,
    if so, whats the mount command. Outlined below is my system drive display.
    Many thanks again!

    [root@localhost ~]# fdisk -l

    Disk /dev/hda: 41.1 GB, 41110142976 bytes
    255 heads, 63 sectors/track, 4998 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/hda1 * 1 13 104391 83 Linux
    /dev/hda2 14 4998 40042012+ 8e Linux LVM

    Disk /dev/hdc: 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/hdc1 * 1 13 104391 83 Linux
    /dev/hdc2 14 9729 78043770 8e Linux LVM

  5. #5
    Join Date
    Oct 2002
    Location
    Illinois
    Posts
    3,289
    uhh no need to format your second disk if you are going to use partimage on it, also you may have to run partimage a second time to load the mbr to the disk so that it boots

  6. #6
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,953
    redrat101,

    If you click Parted Magic in Post #2 it will take you straight into the site for downloading the Live CD iso image.

    Parted Magic is maintained by JL forum member Exodus2001. He used to maintained Gparted. The two Live CDs are very similar and use the same Gparted program.

    In using dd you "DONOT" need any restore. If you buy a target disk identical or larger than the source disk the new disk can be used instantly if you replace the old one with it.

    In a way you can imagine dd is a carbon paper sandwiched between two sheets of paper. Your source disk is the top sheet. The target disk is the bottom sheet. Whatever you write on the first sheet you get it on the second sheet.

    If you use a smaller bottom sheet then you will find parts of the information missing and not copied. You will have a difficulty in understanding its content. This is exactly what happen to the OS that runs it.

    All information, regardless OS, filing types, data..... can only be stored in bits of "1" and "0". dd just copies these "1" and "0" over, as dd stands for "data dump".

    The first sector of a hard disk contains the partition table and will be transferred if the whole disk is cloned. If you has a bigger target disk the excess capacity after cloning just becomes unallocated empty space. However if the target disk is smaller an OS cannot cope because there is missing data area according the partition table, as though someone has chopped off the tail of the hard disk. To uphold its good reputation of being secure and stable no OS will touch such wrongly cloned hard disk. I hope it is clear to you now.

    dd is of course can be used to clone a single word or just a partition.

    In Linux we can hook an external target disk via a USB to clone any internal disk by just specifying the correct device name.

    The speed I got from dd is consistently around 50Mb/s and a 300Gb hard disk can be cloned in less than two hours using a Live CD (Slax 5.0.8). I doubt if Commercial software can beat dd which is one of the oldest commands in Linux.
    Last edited by saikee; 01-03-2007 at 05:38 AM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  7. #7
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488
    I think the real question here is why not boot to a live cd and use dd to clone the drive? I have done this with a Linux only system, several Windows-only systems, and a dual-boot, and all worked without issues.
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  8. #8
    Join Date
    Oct 2002
    Location
    Illinois
    Posts
    3,289
    dd is fine when "cloning" a drive to another, especially when the drive is the same size/model and what not

    when you go to migrate say to a bigger drive or to a smaller drive is when dd starts to lose its usefulness or when you have to clone many machines at the same time, networked applications work much better

    there is still no "ghost" solution that i have found, but partimage is close enough and works fairly well

    if you are just going disk to disk and size changes are not an issue then yea dd is the way to go

  9. #9
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,953
    psych-major

    I think redrat101 has not used dd before as he/she doesn't know the partition does not need to be mounted and a restoring phase unnecessary.

    Parted Magic is a Linux Live CD and has a Linux terminal providing the dd command same as in every other Linux Live CD.

    I view Parted Magic as a Live CD with the latest collection of partitioning weapons (like cfdisk and fdisk). It is good as it allows a user to select the language, keyboard and configure the video before starting the GUI.

    Apart from doing partitioning and resizing together under one roof I think it could make an excellent tool for newbies who cannot find the correct video driver for installing/operating a Linux. They could find it out by "try and error" on the choices provided by Parted Magic on the drivers and resolutions. Parted Magic also logs a user directly into root with out any question asked.

    Try it out as it is a decent piece of kit that no serious Linux user can do without.

    dkeav,

    As far as I could tell I never had a problem to dd a small disk into a big one. The partition table has 4 positions for the primaries. In a smaller disk it can have, for example, 1st, 2nd 3rd and 4th partitions indicating boundaries in the hard disk by address A to F, G to h, i to k and L to R. If this partition table is dd into a hard disk that is bigger and has address all the way to z then the space from s to z will be reported as unallocated space. Technically there is nothing wrong with it and my experience does back this up. I increased my hard disk size from 200Gb to 300Gb, then from 300 to 320Gb and from 320 to 400Gb without any problem.

    I used ghost before I came into Linux and never have to go back. To me Parted Magic is as good as Ghost if not better.

    It seems I am selling Parted Magic to everybody here but it is really superb and I have resized Win2k and XP with it. Before I used Parted Magic its creator Exodus2001 said my opinion on Linux poor ability on resizing difficult partitions was out of date as there has been big advance in this area. His Parted Magic has proved him correct. Thus I think I have a duty to bring to you guys attention of Parted Magic.
    Last edited by saikee; 01-03-2007 at 03:33 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  10. #10
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488
    saikee,
    Per the recent thread about it, I have downloaded parted magic, but haven't tried it yet. Will be tonight in order to set up a friend's pc to dual boot.

    dkeav,
    I agree, and I gathered from the original post that cloning was the end goal. Here's a question: after cloning to a larger drive with dd, wouldn't that leave the new drive with the same size partition as the source drive, with free space at the end, then couldn't parted magic stretch the partition to finish filling up the drive?
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  11. #11
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,953
    Pysch-major,

    To me the point of bringing up Parted Magic is yes. It can move partition around to the left and right, increase its boundary graphically using the mouse pointer and still maintain the integrity of the filing system.

    Older versions of gparted can't "move" the partition and not reliable on ntfs partitions.
    Last edited by saikee; 01-03-2007 at 11:49 AM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  12. #12
    Join Date
    Jan 2003
    Location
    Denver, Colorado
    Posts
    1,488
    That's what I thought, so assuming the parted magic live cd includes dd, then migrating to a larger hard drive would be like this:
    -boot live cd
    -dd if=/dev/old_drive of=/dev/new_drive
    -after completion, launch gparted and stretch the partition to fully utilize the new drive's space
    -done!

    Have to try this, of course, but it sounds doable...
    Slackware current (Dell Latitude D610)
    CentOS 5.2 (Servers)
    Registered Linux User # 375030

  13. #13
    Join Date
    Sep 2004
    Location
    Canada
    Posts
    23
    Sakee:
    I have downlad and used Parted Magic already

    I am now looking for a link to Parted Image Live CD or something similar.
    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •