andromeda@sparcs:/$ ls -al dev/sda* brw-rw---- 1 root disk 8, 0 2014-06-09 18:43 dev/sda brw-rw---- 1 root disk 8, 1 2014-06-09 18:43 dev/sda1 brw-rw---- 1 root disk 8, 2 2014-06-09 18:43 dev/sda2 andromeda@sparcs:/$
# parted /dev/sdc GNU Parted 2.2 Using /dev/sdc Welcome to GNU Parted Type 'help' to view a list of commands. (parted) print Model: Ext Hard Disk (scsi) Disk /dev/sdc: 8001GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags (parted) mklabel gpt Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? yes
BIOS & &
andromeda@wseminar4:/$ sudo fdisk dev/xvda xvda1 xvda2 andromeda@wseminar4:/$ sudo fdisk dev/xvda2 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0xb982dd3e. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help):
Command (m for help): n Command action e extended p primary partition (1-4)
p Partition number (1-4): 1 First cylinder (1-65, default 1): 1 Last cylinder, +cylinders or +size{k,m,g} (1-65, default 65): 5
Command (m for help): p Disk dev/xvda: 536 MB, 536870912 bytes 255 heads, 63 sectors/track, 65 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb982dd3e Device Boot Start End Blocks Id System dev/xvda2p1 1 5 40131 83 Linux Command (m for help):
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (6-65, default 6): 6 Last cylinder, +cylinders or +size{k,m,g} (6-65, default 65): 10 Command (m for help): p Disk dev/xvda2: 536 MB, 536870912 bytes 255 heads, 63 sectors/track, 65 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb982dd3e Device Boot Start End Blocks Id System dev/xvda2p1 1 5 40131 83 Linux dev/xvda2p2 6 10 40162+ 83 Linux Command (m for help):
Command (m for help): n Command action e extended p primary partition (1-4) e Partition number (1-4): 3 First cylinder (11-65, default 11): 11 Last cylinder, +cylinders or +size{k,m,g} (11-65, default 65): 25 Command (m for help): p Disk dev/xvda2: 536 MB, 536870912 bytes 255 heads, 63 sectors/track, 65 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb982dd3e Device Boot Start End Blocks Id System dev/xvda2p1 1 5 40131 83 Linux dev/xvda2p2 6 10 40162+ 83 Linux dev/xvda2p3 11 25 120487+ 5 Extended Command (m for help):
Command (m for help): w The partition table has been altered Calling ioctl() to re-read partition table. andromeda@wseminar4:~$ sudo fdisk -l [sudo] password for andromeda: ( ) Device Boot Start End Blocks Id System /dev/xvda2p1 1 5 40131 83 Linux /dev/xvda2p2 6 10 40162+ 83 Linux /dev/xvda2p3 11 25 120487+ 5 Extended /dev/xvda2p5 11 15 40131 83 Linux
Command (m for help): d Partition number (1-5): 4 Command (m for help): w The partition table has been altered Calling ioctl() to re-read partition table. Command (m for help): p Disk../../dev/xvda2: 536 MB, 536870912 bytes 255 heads, 63 sectors/track, 65 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb982dd3e Device Boot Start End Blocks Id System /dev/xvda2p1 1 5 40131 83 Linux /dev/xvda2p3 11 25 120487+ 5 Extended /dev/xvda2p5 11 15 40131 83 Linux Command (m for help):
WARNING: Re-reading the partition table failed with error 22: Invalid argument. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.
d
andromeda@wseminar4:/$ sudo dd if=/dev/zero of=/swap bs=1024 count=1024 1024+0 records in 1024+0 records out 1048576 bytes (1.0 MB) copied, 0.00806948 s, 130 MB/s andromeda@wseminar4:/$ sudo chmod 0600 /swap andromeda@wseminar4:/$ sudo mkswap /swap 1024 mkswap: /swap: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 1020 KiB no label, UUID=320d097a-6e22-406a-9541-918adafbb993
andromeda@wseminar4:/$ sudo swapon /swap andromeda@wseminar4:/$ sudo swapon -s Filename Type Size Used Priority /dev/xvda1 partition 524280 0-1 /swap file 1016 0-2 andromeda@wseminar4:/$ sudo swapoff /swap andromeda@wseminar4:/$ sudo swapon -s Filename Type Size Used Priority /dev/xvda1 partition 524280 0-1