Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Partition is this the best way?

  • 05-05-2015 2:41pm
    #1
    Registered Users Posts: 16


    Assume disk exists + no partitions already exist

    fdisk /dev/sdb

    select n + p as before

    Partition number (1-4, default 1):
    Using default value 1
    First sector (2048-41943039, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 1000000

    For second partition:
    use default value 1000001
    for last sector, 20000000

    For third partition
    use defaults

    Check with fdisk -l

    Device Boot Start End Blocks Id System
    /dev/sdb1 2048 1000000 498976+ 83 Linux
    /dev/sdb2 1000001 20000000 9500000 83 Linux
    /dev/sdb3 20000001 41943039 10971519+ 83 Linux

    Write file systems to each
    mke2fs /dev/sdb1
    mke2fs /dev/sdb2
    mke2fs /dev/sdb3

    make mount points e.g. p1, p2 + p3 in /media

    Configure fstab as follows:
    /dev/sdb1 /media/p1 ext2 defaults 0 0
    /dev/sdb2 /media/p2 ext2 defaults 0 0
    /dev/sdb3 /media/p3 ext2 defaults 0 0

    Try mounting

    Place an executable in p1
    un mount p1 e.g. umount p1
    Change fstab record (p1) to ro
    mount p1
    try write to p1 (shouldn't work)
    create link ln -s /media/p1/exercise /media/p2/exLink


Comments

  • Closed Accounts Posts: 18,966 ✭✭✭✭syklops


    What exactly are you trying to do?


  • Registered Users, Registered Users 2 Posts: 854 ✭✭✭human 19


    If you havent created partitions before, use a GUI like gparted or the KDE partition manager.
    It gives you a visual cross-section of you disk and you can create new partitions, resize, format to particular filesystem types, change sizes if you are not happy, label (name) them...and all before you hit the "apply" button.

    Moving partitions is a bugger...takes forever...dont do that
    .


  • Registered Users, Registered Users 2 Posts: 1,193 ✭✭✭liamo


    Partition is this the best way?

    In the absence of any information on what it is that you're trying to achieve, I'd have to say that, if you've achieved your objective, then your way is good enough.

    Is it the best way? That depends on what your criteria are for measuring the "best-ness" of it. Quickest? Easiest? Other?


  • Registered Users, Registered Users 2 Posts: 1,456 ✭✭✭FSL


    human 19 wrote: »

    Moving partitions is a bugger...takes forever...dont do that
    .

    If you shrink the partition so there is no free space, move it and then expand it, it takes a lot less time.


Advertisement